Skip to content
snip tools

XML formatter and beautifier

Validate and pretty-print XML with clean indentation. Runs in your browser.

Runs 100% in your browser
 

How to format XML

  1. Paste your XML. Paste minified or messy XML into the input.
  2. Pick an indent. Choose 2 spaces, 4 spaces or a tab.
  3. Copy the result. Copy or download the formatted XML.

About XML formatting

XML from APIs, configs and exports often arrives minified or inconsistently indented. Formatting it reveals the structure so you can read and debug it. This tool first parses the document to confirm it is well-formed — catching the most common breakage, mismatched or unclosed tags — and then prints it with the indentation you choose.

Frequently asked questions

What does the XML formatter do?
It checks that your XML is well-formed, then re-indents it with consistent nesting. Leaf elements that contain only text stay on one line for readability.
Will it tell me if my XML is broken?
Yes. It uses the browser's XML parser, so mismatched tags, missing brackets and other well-formedness errors are reported.
Does it validate against a schema?
No — it checks well-formedness (correct syntax), not validity against a DTD or XSD. Schema validation needs the schema and is out of scope here.
Is my XML uploaded?
No. Formatting happens in your browser.