XML Formatter

Indent size
1 line · 0 B

XML Formatter

Format XML with readable indentation, and see the exact line and column of any parse error.

Output

1 line · 0 B

Formatted XML will appear here.

UTF-8 · XML

About this XML Formatter

Format XML with readable indentation, and see the exact line and column of any parse error.

Your XML is validated and formatted locally in the browser. Nothing is uploaded or stored.

FAQ

Does formatting change the XML content?

No. Only whitespace and indentation change — elements, attributes, and text content stay exactly the same.

Why does the formatter reject my file?

The XML isn't well-formed — usually an unclosed tag, an unquoted attribute value, or mismatched case-sensitive tag names. Fix the reported error and re-run.

Does this work with HTML or XHTML?

Only if it's valid XML. Ordinary HTML often isn't well-formed enough for an XML parser — use the HTML Formatter instead.

Will formatting break meaningful whitespace in mixed content?

It can. When text and child elements are mixed in one node, added indentation may affect how a consuming application reads that whitespace — review the result before using it in production.

Is my XML uploaded to a server?

No. Formatting runs 100% client-side; nothing you paste ever leaves your browser.

Related tools