XML Formatter
Indent and pretty-print messy XML so it's easy to read.
How to use
- Paste your XML.
- It's indented and pretty-printed automatically.
- Copy the formatted XML.
How the XML Formatter works
Indents XML into a readable hierarchy, which makes hand-editing config files, SOAP payloads and RSS feeds far less painful.
The document is walked element by element and re-emitted with indentation reflecting nesting depth, so parent-child relationships become visible at a glance.
Worked example
<a><b>1</b><c>2</c></a> becomes three lines with <b> and <c> indented one level inside <a>.
Things worth knowing
- Unlike JSON, XML distinguishes attributes from child elements, and whitespace can be significant inside text nodes.
- Every opening tag needs a matching close, or a self-closing form. Unclosed tags are the most common XML failure.
- Formatting happens in your browser; nothing is uploaded.
Frequently asked questions
Does it validate the XML?
It formats structure for readability; for strict validation use a dedicated XML validator.
Is my XML uploaded?
No — formatting runs entirely in your browser.
What makes XML invalid?
Unclosed or mismatched tags, more than one root element, unescaped & < or > inside text, and undeclared namespace prefixes.
When should I use XML over JSON?
When you need schema validation, namespaces, attributes or mixed content — or when an existing system requires it. JSON is lighter for most web APIs.