FreeOnlineQR

XML Formatter

Turn a single unbroken line of XML into something with visible structure. Sitemaps, RSS feeds, SOAP responses and build configs all arrive minified, and the nesting is the only thing you actually need to see. Leaf elements like <loc>https://example.com/</loc> are kept on one line rather than being exploded across three, which is the difference between a formatted sitemap you can scan and one that is longer than the original.

Result

Nothing is uploaded — this tool runs inside your browser, so your files never leave your device.

Help us improve

Why use this tool

  • Two-space, four-space or tab indentation
  • Keeps single-value elements on one line so feeds stay scannable
  • Handles a > inside a quoted attribute without losing the tag
  • Tells you if the document isn't well-formed while still formatting it

How it works

  1. 1Paste your XML, however mangled it is.
  2. 2Pick the indentation your project uses.
  3. 3Copy the result, or download it as a text file.

XML Formatter — frequently asked questions

In almost every case, no — whitespace between elements is insignificant to an XML parser. The exception is mixed content, where text and elements share a parent and the spaces between them are part of the text. Whitespace inside a text run is collapsed here, so don't run this over XML where that whitespace is data.

Explore the other tools

Same deal everywhere on the site — free, no sign-up, and no watermark on anything you download.

Or see every tool on one page.