It is possible, and even very easy, using Notepad++ software as an XML editor, to indent an HTML file, using the Notepad++ XML plugin called XML Tools, directly available in the Plugin Manager, which is built in Notepad++ - a great XML viewer by the way.
How to get beautiful XML
If you haven't done it yet, start to install Notepad++ before proceeding.
There, scroll down to find the XML Tools, which should be available there by default. If it is not, you can always download Notepad plus plus from below repository, and see our other article to install plugin.
Before the end of the installation, Notepad plus plus will ask to restart alone. No worries, just like any update in Notepad++, no work will be lost, even if not saved. However, it is of course safer to save all open work before doing this operation :
Some installation steps still need to be completed. Notepad++ needs to be restarted in order to complete these steps. If you restart later, you will be prompted again. Would you like to restart now ?
The data indent with the XML parser - or HTML data indent, as HTML is a specific XML doctype among others, using a specific XML schema - select the Pretty print (XML only - with line breaks) in the XML Tools plugin, this will indent the whole data.
And that's it, the HTML data should now appear properly indented, with visually easy to see separation between the different elements, would it be XML or HTML. It is particularly good to debug HTML, when errors like missing end of tags are reported by checks like the W3C validator, which can be used as an XML validator for HTML.
Notepad++ works that way as a very efficient XML beautifier, making code easy to read, troubleshot and share, probably the best notepad for HTML.
Good luck building your XML document and making great XML code, it should now be much easier with this XML reader ! Also works great for XML pretty print, get an XML file example and see for yourself how to XML structure is properly displayed. XML document structure is very important to respect the XML standard, and benefit from all features of XML.
Using the plugin XML tools, select the auto indent option, also accessible with the keyboard shortcut CTRL + ALT + SHIFT + B.
It is also feasible using menu Plugins > XML Tools > Pretty print, that will indent code in Notepad++.
How to install XML tools plugin for notepad++ 64 bit
Download the latest XML tools plugin package from SourceForge website.
Extract content in Notepad++ installation plugin folder, usually located at “C:\Program Files\Notepad++\plugins”, and restart Notepad++ to have the XML tools plugin appear in Notepad++ plugins list menu.
Once the plugin is installed, the shortcut to format XML in Notepad++ is CTRL + ALT + SHIFT + B.
When getting the error XML Tools unable to load LibXML and/or LibXSLT after having installed the plugin with pluginManager on Notepad++, the solution is to download manually an older version of the plugin, and install the XMLTools library in a specific folder, and the libraries in Notepad++ root folder installation.
The issue should be solve in future versions of Notepad++ starting with 7.62, and work with future Plugin Manager, but it is actually not the case.