XML Formatter | How to use and interpret results
Parse XML with the browser and rewrite elements using two-space indentation. Syntax errors can be shown, but the custom serializer does not preserve every XML node or whitespace meaning.
- Runs in your browser
- Nothing is uploaded
- No signup; device limits apply
Loading the tool. If it does not appear, reload this page.
How to use this tool
Paste XML and compare with the original. Start with a small sample when mixed content, entities, CDATA or declarations are present rather than overwriting an important file.
Results and examples
<root><item>One</item></root> indents item under root. Parsing success does not establish XML Schema validity, and the serialized result should be parsed again for review.
Worked example
<root><item>One</item></root> indents item under root. Parsing success does not establish XML Schema validity, and the serialized result should be parsed again for review.
Limitations
- Whitespace, CDATA, processing instructions and document declarations may not be fully preserved.
- XSD/DTD validation and safe lossless serialization are not guaranteed.
Fields
| Field | Guidance and constraints |
|---|---|
| XML | Check the unit and format displayed beside this field. |
| Result | Check the unit and format displayed beside this field. |
Data handling
Processing stays in the current browser tab; the site does not upload tool input for the calculation itself.
Sources
Frequently asked questions
How are nested elements formatted?
One indents item under root. Parsing success does not establish XML Schema validity, and the serialized result should be parsed again for review.
Can I replace an important XML file unchecked?
Whitespace, CDATA, processing instructions and document declarations may not be fully preserved. XSD/DTD validation and safe lossless serialization are not guaranteed.