How to use XML Formatter
Make an XML document readable by indenting elements according to their nesting. Use it for inspecting a feed, markup example or application export with crowded tags.
- Paste a well-formed XML document or open a file.
- Choose Indentation and format.
- Check both the element structure and areas where words are mixed with inline tags.
- Select Format and review the result.
Example input
<?xml version="1.0"?> <inventory><item id="104">Notebook</item><item id="105">Pencil</item></inventory>
Example use
Review a nested product feed to locate fields under the wrong parent. For document-oriented XML, compare visible text before and after formatting so spaces between neighboring inline elements remain meaningful.
Output and compatibility
The formatter reads XML and serializes its elements. It takes care around mixed content and space preservation, but exact bytes, attribute formatting and some representation details can change. It does not perform canonical XML signing, DTD checks or XSD validation.
Choose a readable copy without losing the original representation
Exact bytes can be important in a signed or archived XML document. Keep that file unchanged and create a formatted version to read. Inspect the namespace and surrounding text of a representative element, not just its indent. If two versions must behave the same in a consuming application, compare the results of that application parsing both files.
Troubleshooting
If a tag mismatch blocks formatting, use XML Validator to find parse errors. Check whether an ampersand in plain text needs an entity and make sure namespace prefixes are declared.
Use XPath Tester to check which elements the destination will read.
Frequently asked questions
Can it format XML with namespaces?
It reads a well-formed XML document, including declared namespaces.
Can formatting alter a signed XML file?
Any serialization change can affect a workflow that relies on exact bytes. Keep the signed original.
Does it validate a schema?
It validates enough to parse XML. A schema-aware tool is needed for XSD or DTD requirements.
Will it add spacing inside mixed-content paragraphs?
It avoids indenting mixed text as ordinary element-only content. Verify meaningful spaces in the final file.
Can I remove indentation instead?
Use XML Minifier for compact output.
Will it repair mismatched tags?
The document must parse first. Use XML Validator to locate the syntax error.