How do I reformat HTML code using Sublime Text?

Well for all those who don’t know what sublime text is ,it’s a code editor which has some very good features that can help your coding,As for formatting HTML codes i will show you a little trick to solve the problem above here if you can follow the procedure below.

You don’t need any plugins to do this. Just select all lines (Ctrl A) and then from the menu select Edit → Line → Reindent. This will work if your file is saved with an extension that contains HTML like .html or .php.

If you do this often, you may find this key mapping useful:

{ "keys": ["ctrl+shift+r"], "command": "reindent" , "args": { "single_line": false } }

If your file is not saved (e.g. you just pasted in a snippet to a new window), you can manually set the language for indentation by selecting the menu View → Syntax → language of choice before selecting the reindent option.