What is an XML formatter?
XML is everywhere — config files, SVG, RSS, SOAP and countless data exchanges — but machine-generated or minified XML is often crammed into one unreadable line. This online XML formatter instantly beautifies messy XML into a clear indented structure, or minifies it to the smallest size, while validating the syntax and flagging errors. Everything runs locally in your browser, with no upload.
How to use
- Paste your XML into the input box (you can also drop in a file).
- Click Beautify to make it readable, or Minify to collapse it to one line.
- Copy or download the result; if the XML is invalid, the status bar explains why.
Common use cases
- Inspect the structure of an API response or config file.
- Tidy the indentation of an SVG or a pom.xml.
- Minify XML before shipping to reduce size. Need JSON? Use the JSON formatter; for JSON⇄YAML use JSON⇄YAML.
"Well-formed" is not the same as "schema-valid"
This tool checks whether XML is well-formed — tags closed, properly nested, attributes quoted. It does not check whether it matches a particular DTD/XSD schema (which elements, attributes and order are allowed) — that needs the schema file. So a "well-formed" result means the syntax is fine, not that a given system will accept it. The most common errors are simple: a forgotten closing tag, inconsistent case (XML is case-sensitive, so <Item> ≠ <item>), and an unescaped & in the text (it must be written &). Need JSON instead? Use the JSON formatter.