If you're working with XML files in Notepad++, formatting them manually could be a cumbersome task especially if the XML files are large.

In this article, I will show you how to format your XML files in a few clicks. I will also show you how to check that the syntax of the XML files is in the right order and all tags are closed.

How to Format XML Files in Notepad++

You can see that the XML file below is not well formatted at all. With the file, I'll demonstrate how to format any XML file in Notepad++:

unformattedxmlfile-1

Step 1: Open your XML file with Notepad++ if you don't have it opened already:
ss1

Step 2: In the menu bar, click on "Plugins" and select "Plugins Admin":
ss2

Step 3: Search for "xml tools", checkmark it in the search results, click install, and select "Yes":
ss3

The plugin will be downloaded and Notepad++ will restart:
ss4

Step 4: Click "Plugins" again in the menu bar, hover on "XML Tools", and click "Pretty print" to format the XML file:
ss5

Now, the XML file is well formatted:
formattedxmlfile

Alternatively, you can press CTRL + ALT + SHIFT + B to do the same thing.

How to Check XML Syntax with Notepad++

If your XML file is really large, the syntax might be bad, and some tags might be missing closing tags.

You can check the syntax with the same XML Tools plugin and it will suggest what you have to do if it finds that anything is wrong.

Again, click "Plugins", hover on "XML Tools" and select "Check XML syntax now":
ss6

Now, it's showing me I didn’t close one of the tags:
ss7

Conclusion

This article showed you how to format your XML files inside Notepad++ with the XML Tools plugin. As already stated, this can be useful if you have to work with large XML files inside Notepad++.

The XML Tools plugin is a great tool for working with XML files in Notepad++ as it gives you a good user experience with XML files. For more information, you can hover on it and see a couple of other useful things you can do with it.

Keep coding.