XML Formatter & Validator
Indent, minify and check XML documents — including SOAP, RSS, SVG and config files.
This tool re-indents XML so nested elements are easy to scan, and can also collapse a document back to a single line. It checks that the markup is well-formed — every tag closed, attributes quoted, one root element — and reports the first structural problem it finds.
The Tree view turns the document into a collapsible outline: fold and unfold any element, search across tag names, attribute names, attribute values and text content (matching branches expand automatically), and copy the location path to any node. It works on any XML dialect — SOAP, RSS/Atom, Maven POM, Android layouts, SVG, config — and runs entirely client-side, so sensitive bodies never leave your machine.
Features
- Pretty-print with configurable indentation, or minify
- Interactive tree view — collapse/expand elements, expand-all / collapse-all
- Search tags, attributes and text; matching branches expand automatically
- Copy the location path (e.g. note/to[1]) to any node
- Well-formedness checking with a readable error message
- Preserves attributes, comments, CDATA and the XML declaration
How to use the xml formatter
- Paste your XML into the input panel.
- In Text view, choose an indentation width and click Format or Minify.
- Switch to Tree view to fold, unfold and search the structure.
- Copy the formatted text, or a node's path from the tree.
Frequently asked questions
How does the tree search work?
Type in the search box above the tree. Tag names, attribute names and values, and text content are all matched case-insensitively; matches are highlighted and the branches containing them expand automatically.
Does it validate against a schema (XSD/DTD)?
No. It checks well-formedness only — that the syntax is valid XML. Schema validation would require fetching external definitions.
Are comments and CDATA kept?
Yes. Comments, CDATA blocks and processing instructions are preserved in the formatted output.
Is the data sent to a server?
No. The formatter runs fully in your browser using a JavaScript XML parser.
Last updated September 10, 2026.