How to format XML
- Paste your XML or open a file.
- Choose the indent, or minify.
- Copy or download the formatted XML.
About this tool
Paste XML and it is checked and laid out with clean indentation. If the XML is not well-formed, such as a tag that is never closed, you see what is wrong and the line and column. Comments, CDATA sections, the declaration and attributes are kept exactly as you wrote them. Text that mixes words and tags is left alone, so no meaningful spaces are lost.
Common questions
What does well-formed mean?
Every opening tag has a matching closing tag, tags are nested correctly, attribute values are in quotes, and there is one root element. This tool checks those rules, not a schema.
Are my comments and CDATA kept?
Yes. They stay where they are. You can choose to remove comments when you minify.
Why is one paragraph not re-indented?
When an element holds both text and tags, like a paragraph with bold words, spaces between them may matter. Such parts are left as written.
Is it free to use?
Yes. There's no sign-up, and you can use it as often as you like.
Is my text uploaded anywhere?
No. This tool runs inside your browser, so what you enter stays on your device.
Do I need to install anything?
No. It works in your browser on a computer or a phone.