Skip to content

XML Formatter

Pretty-print and validate XML documents with proper indentation.

Formatted XML

Paste a document on the left.

About XML Formatter

XML remains the backbone of SOAP services, RSS feeds, SVG graphics and countless configuration formats. Machine-generated XML usually arrives on a single line, which hides the structure that makes it useful.

This formatter re-indents each element by nesting depth, collapses text-only elements onto one line to keep the output compact, and reports well-formedness errors with their location.

Frequently asked questions

Is the document validated?

Yes, it is parsed with the browser XML parser, so malformed markup is reported with the parser own error message.

Are comments and CDATA preserved?

Yes. Comments, CDATA sections and processing instructions all survive formatting.

Does it validate against a schema?

No. Only well-formedness is checked; schema validation is out of scope for a browser tool.

Related tools