XML Formatter: Beautify, Minify and Check XML
Make XML readable, or compact, and catch broken tags before they break your import or feed.
- Works on your device. Nothing is uploaded.
- Free, no watermark
- No signup
How to use
- Paste XML or open an .xml, .svg or feed file.
- Pick 2 spaces, 4 spaces, tab or Minify; keep or drop comments.
- Fix any error shown with its line, then copy or download.
Good to know
The formatter checks that the XML is well-formed: every tag closed in the right order, attribute values in quotes, comments and CDATA closed. The first problem is reported with its line and column, for example "closing tag does not match the open tag".
Elements that hold only short text stay on one line (<name>Sharma Traders</name>). CDATA sections, processing instructions such as <?xml ...?> and the DOCTYPE are kept exactly. Whitespace-only text between tags is removed, and long text is joined into one line.
It does not validate against a schema (XSD) or DTD, and it does not expand entities. If spaces inside an element matter (xml:space="preserve"), check the result, because pretty-printing trims text.
Questions
Can I format an SVG file?
Yes, SVG is XML.
Does it check my XML against a schema?
No, it only checks that the XML is well-formed.
Will formatting change my data?
Tags, attributes and text stay; only whitespace between tags changes.
What does Minify do?
It removes line breaks and indentation for the smallest file.
Is my XML uploaded?
No. Processing happens in your browser.