Paste any XML document and get a clean, indented version instantly. The formatter uses the browser's built-in DOMParser to walk the node tree and emit a tidy result that mirrors the original structure.
How it works
The tool uses the browser's native DOMParser to build an in-memory tree from your XML, then walks the tree to emit either an indented or minified result. Validation reports the parser's error message when a document cannot be parsed.
Processing runs in your browser
All parsing and formatting happens locally in your browser tab. Our servers are not involved at any point.
Frequently asked questions
- Is my XML sent to a server?
- All formatting happens in your browser using the native DOMParser and XMLSerializer APIs. Our servers are not involved at any point.
- Does the formatter preserve CDATA and comments?
- Yes. The walker emits CDATA sections and comment nodes alongside elements so the structure of the original document is preserved.
- Can I format SOAP envelopes or RSS feeds?
- Yes. Any well-formed XML document, including SOAP envelopes, RSS or Atom feeds, SVG markup, and Maven POMs, will format with consistent indentation.
- What indentation does the formatter use?
- Two spaces by default. The tool emits nested elements on new lines with leading spaces matching the depth of each node.
- Does formatting change my XML's meaning?
- Formatting only adjusts whitespace between tags. Attribute order and content remain identical to the input document.