Skip to main content
← Home

XML Formatter & Viewer

Format, beautify and validate your XML

Input XML

Formatted results will appear here. Your last 3 runs are kept.

Format and validate XML online

The input is parsed with the browser's XML parser first, so unclosed tags, mismatched names or a second root element are reported as errors. Valid XML gets line breaks and two-space indentation; only whitespace between tags changes. The last three results stay on the page for diffing.

Examples

Input
<note><to>Ann</to><from>Bob</from><body>Hi!</body></note>
Formatted output
<note>
  <to>Ann</to>
  <from>Bob</from>
  <body>Hi!</body>
</note>
Invalid: tags closed in the wrong order
<a><b></a></b>

Frequently asked questions

What makes XML invalid?

Typical errors are a missing closing tag, tags that close in the wrong order, more than one root element, unquoted attribute values and unescaped & or < characters in text.

Does the formatter change my data?

No. Only whitespace between tags is changed; element names, attributes and text stay the same.

Is my XML uploaded anywhere?

No. Parsing and formatting happen locally in your browser.

Related tools