Home › Developer Tools › XML Formatter

XML Formatter & Validator

Pretty-print XML so it's easy to read, find errors with the exact line, or minify it to save space.

Open an XML file or paste below

How to use XML Formatter

  1. Paste XML or open a file (XML, SVG, RSS, sitemap…).
  2. Pick beautify or minify, indent size and whether to keep comments.
  3. Copy the result or download it.

Validation

Your browser's XML parser reads the document first. If a tag isn't closed, an attribute isn't quoted or there's a stray &, you get the line and column of the problem instead of a broken result.

What is kept

  • The XML declaration and DOCTYPE.
  • Text exactly as written, including mixed content like <p>Hello <b>world</b></p>.
  • CDATA sections, processing instructions and (optionally) comments.
  • Attribute order and namespaces.

Frequently asked questions

Can it format SVG, RSS or sitemaps?

Yes, they are all XML.

Does it check against a schema (XSD)?

No, it checks that the XML is well-formed, not that it matches a schema.

Can it convert XML to JSON?

Not yet. Try our YAML and JSON tools for config files.

Is my file uploaded?

No, it is processed in your browser.

Related tools

More Developer Tools