Skip to content

Format XML

This tool reads an XML document and writes it out with the indentation you choose, which turns a single dense line into something you can follow. Whitespace between elements counts as formatting here, not as data, so the result depends on your setting and not on how the file happened to look. Formatting runs in your browser, and your file is never uploaded.

Runs in your browser

Drop a file here

XML, up to 50 MB

How it works

  1. 1 Choose an XML file.
  2. 2 Set the indent between 0 and 8 spaces. 2 is the default, 0 minifies.
  3. 3 GRID16 parses and rewrites the document in your browser.
  4. 4 Download the result.

Questions

Can it minify as well?
Yes. An indent of 0 drops the formatting whitespace between elements and writes the document compactly.
What happens with invalid XML?
The job stops and says so. The document has to parse first, so a missing closing tag is reported instead of being written back out.
Does my own formatting matter?
No, and that is the point. A minified file and a hand indented one produce the same result for the same indent, because whitespace between elements is treated as formatting.
Is my file uploaded to a server?
No. Formatting happens in your browser; the file never leaves your device.