Paste XML and this page indents each nested tag by two spaces. It does not validate against a schema or call a server.
Runs in your browser. Nothing you enter is uploaded.
| Output | <root> <item id="1">Hello</item> <item id="2"/> </root> |
|---|
A tag that already contains its text and its closing tag on one token stays on one line. Self-closing tags do not add a level.
| Token | What happens |
|---|---|
| Opening tag | Printed at the current indent, then the indent increases |
| Closing tag | Indent decreases, then the tag is printed |
| Self-closing tag, or <? or <! | Printed, indent unchanged |
| Whitespace between tags | Removed before the split, so gaps do not become extra lines |
Format and beautify XML so deeply nested elements become readable with consistent indentation. Minified or single-line XML from SOAP responses, RSS feeds, SVG files and config exports is nearly impossible to scan by eye, and this tool fixes that instantly. It indents each level, keeps attributes on their opening tags, preserves text content, and leaves self-closing tags intact. It works purely on the text structure, so it does not rewrite or strip your data, it just makes it legible. Paste your XML, click format, and copy the tidy result. All formatting happens in your browser, so proprietary payloads and internal service responses are never uploaded or stored anywhere.
No. It pretty-prints the text. A broken tag is not reported as a parse error by this formatter.
Two spaces per level.
No. Formatting runs in the browser.
Give your verdict. Sign-in needed to vote and comment.
Link this tool from a README, doc or site. The badge links back to this page.
[](https://yourhack.ai/xml-formatter)