Toolantern
Home › XML Formatter & Validator
Free tool. No sign-up.

XML Formatter & Validator

Pretty-print XML with clean indentation, minify it to one line, and validate well-formedness with clear error messages pointing at the problem.

What the tool does

Paste XML and choose: pretty-print it with two-space indentation so the structure is visible, or minify it to a single line for transport. Either way the document is parsed first, so malformed XML is reported with the parser's error message instead of silently mangled.

Worked example

<root><item>1</item></root> pretty-prints to:

<root>
  <item>1</item>
</root>

Common errors

Unclosed tags, mismatched open/close names, unescaped & in text, and multiple root elements are the usual suspects. The validator names the first problem it finds.

Planning estimate only. Results use the list prices shown and may differ from your actual bill. Terms

Frequently asked questions

What does valid XML mean here?

Well-formed XML: one root element, correctly nested and closed tags, quoted attributes, and escaped special characters. This is not schema validation against a DTD or XSD.

Does it validate against an XSD?

No. Browsers do not ship an XSD validator, so this tool checks well-formedness only, which catches the vast majority of real-world XML mistakes.

Can it handle large files?

Yes, within reason. Multi-megabyte documents format fine in the browser; extremely large files may be slow because the whole document is held in memory.

Is my XML sent to a server?

No. Parsing and formatting happen locally in your browser.

More free tools