XML Formatter & Minifier
Beautify or minify XML, and validate that it's well-formed.
The XML Formatter beautifies dense or minified XML into clean, indented markup — and can minify it back down for transport. It parses your document with the browser's XML engine, so it also tells you when the XML isn't well-formed, pointing at the parse error. Attributes, comments, and CDATA sections are preserved.
- ✓Beautify with 2 or 4-space indentation, or minify
- ✓Validates well-formedness and reports parse errors
- ✓Keeps attributes, comments, and CDATA
- ✓100% private — nothing is uploaded
Well-Formed vs Valid XML
This tool checks that XML is well-formed— properly nested tags, quoted attributes, a single root element — which is what a parser requires to read it at all. That's different from being valid against a DTD or XSD schema. To move between formats, see XML to JSON and JSON to XML.
How to Use It
- 1Paste minified or inconsistently-indented XML into the input.
- 2Click Beautify for readable, indented output, or Minify to strip whitespace for transport.
- 3If the document isn't well-formed, the parser's error is shown instead of a broken result — fix the reported issue and reformat.
- 4Copy the output back into your file, request body, or config.
Well-Formed vs Valid XML
This tool checks that XML is well-formed— properly nested tags, quoted attributes, a single root element — which is what a parser requires to read it at all. That's different from being valid against a DTD or XSD schema. To move between formats, see XML to JSON and JSON to XML.
Common XML Mistakes This Catches
- ▸Unclosed or mismatched tags — Every opening tag must have a matching closing tag in the right order — the parser error points to exactly where nesting breaks.
- ▸Unquoted attribute values — Unlike HTML, XML always requires quotes around attribute values (id="1", not id=1) — this is one of the most common well-formedness failures.
- ▸Multiple root elements — An XML document must have exactly one top-level element; a second sibling at the root level fails to parse.
- ▸Unescaped special characters — A raw & or < inside text content must be escaped as & or < — otherwise the parser reads it as the start of a new tag or entity.
Common Uses
- ▸Reading API responses — Pretty-print a minified SOAP or REST XML response so you can inspect its structure.
- ▸Config and build files — Tidy pom.xml, web.config, or Android layout files for readable diffs.
- ▸RSS and sitemaps — Format feed and sitemap XML and confirm it parses before publishing.
- ▸Minifying for transport — Strip whitespace to shrink XML payloads sent over the wire.
- ▸Debugging SOAP requests — Beautify a raw SOAP envelope to read the nested body and headers clearly.