sylvain + whissell = geek

From C# to pin sharp (and everything in between).

Using Notepad++ To Quickly Format XML

My favorite way to quickly format a given chunk of XML is to use Notepad++ and the XML Tools plugin.  You can get Notepad++ here.  And the XML Tools plugin is here (you’ll have to wait a few seconds before the download starts).

Installing Notepad

(the following instructions are based on Notepad++ v5.9.4 and my differ in later versions)

1) Choose your language:

image

2) Click Next:

image

3) Agree to the License Agreement:

image

4) Choose where you want to install the files:

image

5) Choose what options you want to install (I simply use the defaults):

image

6) Choose the final set of options.  I check the first one because I like having applications keep their data in their own installation directory:

image

7) Click Install:

image

8) Click Finish and you’re done!

image

 

Settings In Notepad++

There are a few settings that I always set that (I find) make life more convenient (but that’s just me).

Under Settings | Preferences:

image

On the “General” tab, I check “Show close button on each tab”.

image

On the “MISC.” tab, I uncheck “Remember current session for next launch” because I always want Notepad++ to open with a new blank document.

image

 

Installing the XML Tools

If you run Notepad++ and look in the Plugins menu, you’ll see that the XML Tools aren’t there:

image

1) Download the XML tools from here.

2) Unzip the file and copy the XMLTools.dll to the Notepad++ plugins folder (in the example above: C:\Program Files (x86)\Notepad++\plugins):

image

3) Re-start Notepad++ and you should now see the XMLTools appear in the Plugins menu:

image

When you click on “How to use…” you’ll get the following:

image

4) I’ve just tried (2011/10/20) following those links and the first one doesn’t work and the 2nd one just takes you to a directory listing. So, I’ve uploaded the zip file to my site and you can download the missing lib files from here.

5) Unzip the ext_libs.zip file and then copy the unzipped DLLs to the Notepad++ installation directory (in the example above: C:\Program Files (x86)\Notepad++):

image

6) Re-start Notepad++ and you should finally see the proper XML Tools menu:

image

The feature I use the most is “Pretty print (XML only – with line breaks)”.  This will format any piece of XML with all the proper line spacing.

Start with:

image

After doing Ctrl+Alt+Shift+B:

image

Sweet!

  • Mike Miller says:

    Thanks for the help – I played around with the Tidy stuff and all I got was exceptions. Read your article and bang – Done!

    August 31, 2011 at 15:59
  • geek says:

    No worries at all. Glad it was useful!

    August 31, 2011 at 16:43
    • Kristian says:

      Thanks a lot, man! This is really helpful!

      November 27, 2013 at 23:43
  • Ty Pillet says:

    I can’t figure out how to set this up. I just get a “how to use” option which then produces the error above, but I can’t figure out what to do next. Please can you give us more details? I appreciate it. Thank you for this in formation.

    JV

    October 20, 2011 at 11:43
  • geek says:

    Hey Ty,

    I originally wrote this well over a year ago. I just tried the links for the missing lib files and they seem to be broken. I’ve uploaded the zip file to my site and I’ve also totally re-written this post with detailed instructions. It should be much clearer now on how to set this up.

    Cheers.

    October 20, 2011 at 15:31
  • Prathap says:

    Very nice post… Was very useful.

    October 25, 2011 at 04:39
  • Prady says:

    Super useful info…worked like a gem!!

    November 9, 2011 at 11:12
  • Divya B Rajendra says:

    very helpful post… Thank you very much… !! :)

    November 16, 2011 at 04:19
  • bfoxx says:

    Thanks Man. Very Helpful

    December 1, 2011 at 09:35
  • Charlie says:

    Thanks – works exactly as you say – proper job!

    December 1, 2011 at 11:44
  • JK says:

    Great work! The picture & short comments are very good explanation. It is a spoon feed for anyone. Thank you for your work. Blessings.

    December 7, 2011 at 09:31
  • Spork says:

    Thanks for writing this post. I wanted to quickly format XML messages from log files and the other options I tried didn’t work or weren’t compatible with my app version (see http://stackoverflow.com/questions/193728/free-xml-formatting-tool and http://stackoverflow.com/questions/412427/auto-indent-in-notepad). Once all the proper libs were available the XMLTools plugin did exactly what I wanted!

    December 16, 2011 at 11:54
  • Greg says:

    Good contribution mate.
    Thanks

    January 1, 2012 at 12:09
  • harini says:

    great!
    thanks

    January 12, 2012 at 04:04
  • harini says:

    great job
    thanks, it’s very useful

    January 12, 2012 at 04:22
  • Petar Repac says:

    Tnx

    February 1, 2012 at 10:06
  • bob9 says:

    Awesome Effort Champ..

    February 4, 2012 at 09:43
  • prabu says:

    Thanks..very useful

    February 10, 2012 at 02:38
  • gimme says:

    Awesome stuff – only wish I found this post months ago!

    February 17, 2012 at 00:34
  • Harish says:

    Excellent article. Worked like charm

    February 23, 2012 at 02:13
  • Amy says:

    Awesome! I love you. Seriously. I had a bunch of XML files that didn’t have the xml extension and so the built-in notepad++ formatting didn’t work. This tool and your explanation and help were amazing.

    February 23, 2012 at 12:07
  • geek says:

    Ha ha! Thanks Amy. Glad it helped you out.

    February 23, 2012 at 12:44
  • Mushu says:

    Awesome Post!!! Thank you

    February 28, 2012 at 04:57
  • Steve says:

    You rock! Thanks so much!!!

    March 5, 2012 at 15:42
  • Ranjan says:

    Awesome, was always thinking of something like this. At some point felt like I need to write a plugin of my own. Fortunate to have found this. Thanks for giving a walkthrough which even a kid can understand.

    March 20, 2012 at 14:45
  • mad says:

    Was very useful..thank you…its working like a charm now

    March 21, 2012 at 04:41
  • Claudio says:

    Excellent tip, used it a few times already. However, I just today re-installed NP++, now on version 6.0, and was greeted with the error that the plugins on which XML Tools depend are compiled as ANSI, and thus incompatible with NP++ (Unicode-compiled). I’m yet to dig around for alternate plugin files, but thought I’d leave this note for folks …

    March 29, 2012 at 13:19
  • geek says:

    Thanks for the heads up Claudio!

    March 29, 2012 at 20:28
  • Bob Savage says:

    Thanks, that really helped me a lot.

    April 2, 2012 at 12:52
  • efvr :) says:

    The tool is now available in latest Notepad++ v6.1

    Just simply install the latest version.
    Then go to Menu -> TextFX -> TextFX HTML Tidy –> Tidy: Reindent XML

    April 12, 2012 at 23:41
  • zackoljica says:

    That realy helped me a lot! Thanks so mutch! :)

    May 9, 2012 at 05:06
  • Nenad says:

    Cool stuff, thx man!

    May 9, 2012 at 05:14
  • Lilo says:

    Thanks mate! Saved me a great deal of time right before a presentation I had to do… Brilliant!

    May 18, 2012 at 06:51
  • Hemant says:

    Thanks a lot. This is really helpful.

    May 24, 2012 at 08:19
  • Jerome Anthony says:

    Thanks mate

    May 28, 2012 at 20:59
  • Rooman says:

    Wonderful..i was looking for similar option in notepad++ and it worked for me. brilliantly explained.

    May 31, 2012 at 05:41
  • Vishnu says:

    Thanks for the neat explanation. It worked

    June 15, 2012 at 03:17
  • bala says:

    Thanks for the detailed explanation…

    June 20, 2012 at 15:34
  • CybsAk says:

    Thanks a ton for the step by step guide.

    July 5, 2012 at 15:03
  • Nandeesh says:

    Thanks a lot for the detailed explanation. I got the formatted xml in a jiffy.

    July 9, 2012 at 08:15
  • Manthan says:

    Thanks ! This saves my day :)

    July 12, 2012 at 01:23
  • kanth says:

    Thank you very much. Neat explanation

    July 19, 2012 at 00:43
  • ace.spades says:

    Great Guide! Really helpful! :)
    Thanks!

    July 24, 2012 at 23:15
  • satish says:

    Really useful one.. thanks buddy…

    July 26, 2012 at 04:50
  • Mitesh says:

    Usefull information… Thanks

    August 3, 2012 at 08:25
  • Sjaak says:

    Great to have found this detailed explanation. Thanks

    August 22, 2012 at 04:25
  • Smith says:

    Thank you for the tip and more importantly thank you for taking the effort to host the required files yourself. Much Appeciated!

    August 23, 2012 at 09:08
  • praveen says:

    Great, Thanks!

    August 29, 2012 at 18:53
  • Marco Faustinelli says:

    Thank you.
    Thank you.
    Thank you.

    August 31, 2012 at 00:30
  • ion173 says:

    Thank you

    September 3, 2012 at 02:57
  • Ramakrishna says:

    Thanks a Lot !! Looks like a very good plugin supporting various processing on xml

    September 6, 2012 at 05:00
  • Daniel says:

    Thanks a lot – really well explained. Very useful !

    September 12, 2012 at 02:15
  • spunti says:

    Takes half an hour for a 30 MB XML-file (5 minutes for a 10 MB XML-file) but it works! Thanks for the missing libraries and your instructions.

    September 12, 2012 at 03:36
  • Matt says:

    From Google search to formatting unformatted XML in less than 5 minutes. Sweet article! Just what I needed

    September 14, 2012 at 08:05
  • Santosh says:

    Thanks for a beautiful article. Just what I needed.

    September 16, 2012 at 10:56
  • Jusch says:

    Great tutorial!! Thanks :)

    September 25, 2012 at 03:08
  • TIb says:

    Thanks a lot, exactly what I needed!

    September 25, 2012 at 08:17
  • Mohammed Abdul Kader says:

    Thanks for very nice post… Was very useful.

    September 27, 2012 at 01:38
  • Adrian says:

    Thank you!

    September 27, 2012 at 22:32
  • FebyFelix says:

    Awesome!!!!!… This was the best article i could find about any kind of installation. Thank you so much for the steps with screenshots.

    Thanks,
    Feby

    October 2, 2012 at 14:55
  • guleryuz says:

    thank you

    October 11, 2012 at 02:12
  • Suresh says:

    Awesome it works

    October 24, 2012 at 10:01
  • Abhay Kumar says:

    You rock! Great step by step approach. Thanks for your help you saved my day.

    October 31, 2012 at 18:01
  • bala says:

    I have recently downloaded notepad++ 6.2.1 version (which is the latest one) and it is not allowing me to install ‘xml plugin’.
    I’ve tried all the steps…but still not able to install the plugin.
    Also, I could not find — (Menu -> TextFX -> TextFX HTML Tidy –> Tidy: Reindent XML) this option.

    Could any one please me on this.

    November 15, 2012 at 16:23
  • geek says:

    Doh that sucks. I’m not sure I’ll have time tonight but I’ll try looking into this in the next couple of days and get back to you…

    November 15, 2012 at 16:44
    • bala says:

      HI Geek,

      AT your free time, could you look in to the issue, we faced with the newer version of notepad ++

      November 19, 2012 at 13:11
  • Benjamin says:

    +1 very nice.
    Now notepad++ is really perfect :)

    November 16, 2012 at 05:55
  • geek says:

    Unfortunately things are a bit crazy for me at the moment and I won’t have time to look at this until next week. As soon as I do, I’ll post an update here…

    November 21, 2012 at 09:03
  • Trick says:

    GREAT JOB ! THANKS!

    November 25, 2012 at 05:40
  • geek says:

    To bala:

    Apologies for taking so long to get back to you. I had some free time tonight and started from scratch with Notepad++ totally removed from my laptop.

    I downloaded the latest version of Notepad++ (v6.2.2) and then followed the instructions in this post and had no problems installing the XML tools.

    Did you make sure to re-start Notepad++ after installing the XMLTools dll and the ext_libs dlls?

    December 3, 2012 at 20:29
  • George Fisher says:

    Your instructions for Pretty Print for XML worked perfectly and have made my life much nicer. Thank you

    December 4, 2012 at 12:07
  • neeraj says:

    Very well illustrated, it was helpful. thanks

    December 6, 2012 at 17:08
  • Luke MK says:

    Thank a Million buddy!!!

    December 18, 2012 at 21:27
  • Jenny says:

    Thanks, still useful!!! You made that a cinch.

    January 8, 2013 at 15:01
  • Manjunath says:

    It is very helpful and easy to do it :)

    January 10, 2013 at 23:07
  • Eric says:

    WOW! I’ve been looking for something that will do a simple XML format. I was using Eclipse, which is overkill. Thanks!!!

    January 17, 2013 at 11:31
  • prabu says:

    Good Effort. Must be appreciated. Thanks.

    January 31, 2013 at 01:08
  • Tatiana says:

    Cool!
    Such an easy and precise description!
    It worked at once!

    Thanks a lot!!!

    January 31, 2013 at 09:04
  • SodaCitron says:

    Brilliant and excellent article, you saved me a lot of time ! Thank you

    January 31, 2013 at 09:38
  • sanket says:

    Thanks.

    February 5, 2013 at 12:33
  • Kaplan says:

    Thanks a lot for this article! Great help!

    February 26, 2013 at 22:16
  • sparaflAsh says:

    I quote all the people above: Great tutorial.

    March 14, 2013 at 06:27
  • Chris says:

    Thanks for this article. Very detailed and worked fine immediately. Exactly what I was looking for.
    Chris

    March 15, 2013 at 09:33
  • Jitendra says:

    I have been trying since a week to get my XML file look well until i found this page. Easy and simple steps with proper attachements. Thanks a lot
    - Jitendra

    March 19, 2013 at 03:15
  • dreqzack says:

    I just want to say thank you.
    Now my notepad++ is complete!

    March 27, 2013 at 05:07
  • Eder D. says:

    Thanks for this tutorial. It was really useful!

    March 27, 2013 at 17:17
  • bhagyashree says:

    very helpful

    April 1, 2013 at 15:12
  • Jesse says:

    Thank you!! I’ve been looking for those dll files for months!

    April 9, 2013 at 17:47
  • SCOOL says:

    super :)

    April 10, 2013 at 04:17
  • Rogerio says:

    Thanks… It helped a lot with xml tool…

    April 26, 2013 at 15:32
  • Chandima says:

    Thanx. It very helpful to me.

    May 17, 2013 at 22:17
  • GS says:

    Nice work mate!

    May 20, 2013 at 10:43
  • Doug says:

    Thanks a lot, man. Worked a treat

    May 24, 2013 at 06:48
  • K Chan says:

    If more web pages are this useful, our lives would be much easier! Instructions are not only clear, but the links and the install work great! Thank you!

    June 1, 2013 at 23:09
  • Loko says:

    Many thanks, very useful

    June 7, 2013 at 04:31
  • Niraj Gurav says:

    Thanks. Your article helped a lot.

    June 25, 2013 at 02:00
  • Venkat says:

    Thanks a bunch .. for xml formatting.. It helped a lot

    July 19, 2013 at 01:19
  • Samuel Haddad says:

    This is awesome. I work with XML files all the time. I was using HTML Tidy as part of TextFX for a while, but I use XMLTools now because I can easily set a keyboard shortcut!!

    Every second counts. Thanks for the quick tips.

    July 19, 2013 at 13:37
  • rvera says:

    It works!… Thank you very much!

    July 29, 2013 at 12:12
  • Ken says:

    I couldn’t agree more with all the very positive comments above. Yours is one of the most clearly written walkthroughs I’ve seen and I am looking at some “pretty” xml files as a result.
    Thank you much!!

    July 29, 2013 at 17:26
  • stephen kane says:

    Thanks, useful article

    August 5, 2013 at 11:39
  • Mike says:

    Perfect Thanks!

    August 8, 2013 at 09:50
  • still looking says:

    The link from the article to : http://geek.sylvainw.com/resources/ext_libs.zip

    brings me to an empty page with an apology. no XML Tools dll.

    August 16, 2013 at 08:37
  • geek says:

    Apologies for that. The servers at my web hosting company were just migrated and the file must not have made it across. Unfortunately I’m away until Monday but will re-upload the file when I’m back.

    August 16, 2013 at 08:55
  • geek says:

    I’ve re-uploaded the file so the link should now work. http://geek.sylvainw.com/resources/ext_libs.zip

    August 19, 2013 at 21:20
  • Lazy Developer says:

    Thanks. I’m sure you’ve saved me some time looking for those missing .dll’s

    August 23, 2013 at 11:10
  • Inky says:

    It works!… Thank you very much!

    August 28, 2013 at 09:42
  • vijay says:

    thanks bro

    September 12, 2013 at 06:44
  • ornit says:

    thank you thank you thank you
    You helped me

    September 17, 2013 at 03:21
  • Steve says:

    Thank you very much. This is a great help to me.

    September 19, 2013 at 15:12
  • Johanna says:

    YEEEEEEEEY!!! Thanks, you saved me today!

    October 2, 2013 at 02:49
  • chopu says:

    Thank you for the info, very usefull and well explained. =D

    October 8, 2013 at 11:10
  • Ellioh says:

    Perfect! :)

    October 24, 2013 at 12:26
  • Rob Bramhall says:

    Works great!

    October 25, 2013 at 11:33
  • Dr Kaos says:

    Great stuff… I typically use(d) ArchiTag X-Ray for XML/XSL, but now…. hmmmmm…..

    November 7, 2013 at 11:55
  • Mark says:

    This is great! Thanks for the clear instructions and even the .dlls! A true public service.

    November 20, 2013 at 17:55
  • Ubadi Raja says:

    Thank you so much, that was great. All resources working and nicely build guide.

    November 25, 2013 at 06:33
  • Alpha geek says:

    Nicely done. Very clear and useful.

    December 3, 2013 at 09:20
  • Sunda says:

    This was great… well structured and really useful.

    December 11, 2013 at 18:07
  • Steve says:

    Thanks for the instructions! Clear, concise and easy to follow!

    Resolved my problem in 5 minutes!

    January 17, 2014 at 08:30
  • VBui says:

    Thank you!!

    February 18, 2014 at 19:18
  • Sherman Woo says:

    Awesome, just awesome. Thank you so much!

    February 19, 2014 at 13:33
  • veera says:

    Awesome post, Thank you so much..

    February 28, 2014 at 02:59
  • Pragnya says:

    Hi,
    Thank you very much!

    regards,
    Pragnya

    March 4, 2014 at 10:06
  • Butchi Reddy Velagala says:

    Thank you very much. Your document was awesome.

    March 10, 2014 at 04:38
  • Praveen Subramaniyan says:

    Thank you for your instructions! it’s simply awesome!!

    March 10, 2014 at 23:22
  • Danish says:

    Awesome!!!

    March 12, 2014 at 14:14
  • Baltazar says:

    Thanks :)

    March 20, 2014 at 10:03
  • Abdellah AZIZI says:

    thakns, but what about last vesion of notepadd++ v6.5.5 installed in windows 8?

    March 29, 2014 at 14:13
  • geek says:

    Hi Abdellah,

    I don’t use Windows 8 and have never tried installing Notepad++ on it. But there isn’t anything fundamentally different about Notepad++ that would prevent it from installing as a desktop application on Win 8. Best advice I can give you is to try it out and let us know how it went!

    Cheers,
    Sylvain

    March 30, 2014 at 17:11
  • Caleb Villeda says:

    Thank you so much. Great article.

    April 8, 2014 at 17:54
  • Martin C says:

    Spot on! Super advice, worked a treat. Thanks a bunch!

    April 10, 2014 at 08:45
  • mkh says:

    Super! Thank you very much!

    April 15, 2014 at 04:29
  • Oliver M. says:

    Thanks for the very detailed description. This was very helpful, also your personal settings.

    April 15, 2014 at 04:31
  • Abhi says:

    Fantastic presentation!! Very Very useful and helpful. Cheers

    April 21, 2014 at 20:48
  • Reinaldo says:

    Muito bom…perfeito…Me ajudou muito!!!

    April 23, 2014 at 13:18
  • amir says:

    tq so much for your help..really appreciate it! :) )

    April 28, 2014 at 21:39
  • shrikant says:

    Great Work. Thanks lots, saved lots of my energy and time.

    April 29, 2014 at 07:28
  • Marco Faustinelli says:

    Very good tips, here. I have a question. How do you EXACTLY work with the “Tag auto-close” feature?
    I have turned it on, but still no closing tags are automatically drawn. I have tried pressing CTRL-whatever after completing the opening tag. How does that feature work exactly? Thank you in advance.

    May 3, 2014 at 04:17
  • geek says:

    Hey Marco,

    Just had time to play around with the “Tag auto-close” feature. With it on, the closing tag will automatically be inserted into your document when you type the “>” of the opening tag.

    So for example. If you type (without the quotes) “” to close the tag, the plugin will insert the closing tag so that you end up with ““.

    Hope that helps.

    May 11, 2014 at 16:39
  • Benny says:

    I think an easier way to install the XML tools would be to use the built in Plugin Manager.

    Just go to Plugins->Plugin Manager. Under Available, find XML Tools and install that.

    July 7, 2014 at 02:01
  • geek says:

    Hey Benny. Thanks heaps for the tip!

    In all the years I’ve been using Notepad++ I’ve never used the Plugin Manager and I think I originally installed the XML Tools manually like I described above.

    I tested by uninstalling my current version of Notepad++ and then re-installing everything, including the XML Tools through the Plugin Manager and it works perfectly.

    I’ll update the article at some point with the new instructions as I agree that it’s way more straightforward to use the Plugin Manager.

    Cheers.

    July 7, 2014 at 18:04

Your email address will not be published. Required fields are marked *

*