Home โ€บ Developer Tools โ€บ XML Formatter

๐Ÿงพ XML Formatter

Pretty-print XML with clean indentation, validate it, or minify it back to one line.

About this XML Formatter

XML from APIs, config files and data feeds often arrives as one unreadable line โ€” or with an error hiding inside it. This formatter parses your XML with the browser's real XML parser, so invalid markup is reported instead of silently mangled, then re-prints it with clean two-space indentation following the element nesting. The minify button strips it back down for storage or transmission.

How to use it

  1. Paste your XML into the box.
  2. Click Beautify XML to validate and indent it.
  3. If it is invalid, read the parser's error to find the broken spot.
  4. Use Minify when you need the compact version instead.

Example

The one-liner <root><item><name>Test</name></item></root> becomes three indented lines with root, item and name nested clearly โ€” and a missing closing tag would be flagged as invalid.

Frequently asked questions

Does it validate against a schema?

It checks well-formedness โ€” matching tags, one root element, legal characters โ€” using the browser parser. It does not check DTD or XSD schemas.

Is my XML sent to a server?

No. Parsing and formatting happen entirely in your browser tab.

More Developer Tools