input.xml
output.xml
Paste XML to pretty-print it with consistent indentation.

Related

Guides for XML Formatter

All guides →

Online XML Formatter & Beautifier

Paste minified or messy XML and click Format to pretty-print it with clean, consistent indentation. This online XML formatter runs entirely in your browser — your data is never uploaded — so it is safe for API payloads, config, and feeds.

  • Beautify XML — turn one-line XML into a readable, indented tree
  • Choose indent width — 2 or 4 spaces
  • Keeps structure — attributes, comments, CDATA, and the XML declaration are preserved
  • Private — an XML beautifier that works locally, with no upload

Format XML with correct indentation

The formatter re-indents elements by nesting depth without touching your data. Comments (<!-- -->), <![CDATA[ ]]> blocks, processing instructions, and attribute values are preserved, so the formatted output is the same document — just easier to read.

Need the data as JSON instead? Use XML to JSON or the JSON ⇄ XML converter. For web markup, see the HTML Formatter.

FAQ

How do I format XML online?

Paste your XML, pick an indent width, and click Format. The tool re-indents every element by depth and you can copy the result — all locally in your browser.

Does formatting change my XML data?

No. It only adjusts whitespace between elements. Attributes, text, comments, and CDATA are preserved, so the document stays equivalent.

Is my XML uploaded anywhere?

No — the XML formatter runs entirely in your browser, so it is safe for confidential or internal data.