XML Formatter
Format or compact XML, inspect its tree and compare documents. Check well-formedness, review errors, then copy or download the XML output.
Format or compact XML, inspect its tree and compare documents. Check well-formedness, review errors, then copy or download the XML output.
- Prepare your input
Choose the relevant options using the controls below.
- Run your task
Adjust the controls below and inspect the preview.
- Use the result
Check the result, then use the available copy or download controls.
Scope and limits
Browser XML well-formedness only; no XSD/DTD validation. DTD/entity declarations are rejected. Pretty printing changes element-only indentation; compact serialization preserves text spaces and CDATA. Comparisons inspect node/attribute values, order and whitespace. Limits: 1 MB UTF-8, 20,000 nodes, 64 levels.
Input XML
Settings
Formatted Output
Formatted XML will appear here
Input XML
Minified Output
Minified XML will appear here
Input XML
Validation Results
Validation results will appear here
Original XML
Modified XML
XML Formatter
Make an XML document easier to inspect before reviewing an API response or configuration file. Formatting adds indentation to element-only content; compact serialization preserves text spaces and CDATA. Use the tree to inspect structure, or compare two documents when you need to examine node and attribute changes.
For a small example, use a root element containing an item with id="1" and text XML. The syntax check tests browser XML well-formedness, not XSD or DTD validity. DTD and entity declarations are rejected. Comparisons consider node order and whitespace. Input is limited to 1,000,000 UTF-8 bytes, 20,000 nodes and 64 levels.
Features
- Format XML with indentation or create compact output.
- Check well-formedness and inspect reported errors.
- Explore the document tree or compare two XML documents.
- Copy or download XML while retaining text spaces and CDATA in compact serialization.
How to use
- Paste XML or use the built-in sample, then choose the required operation.
- For readable output, select indentation and format. For compact output, use the compact operation.
- Inspect the tree or comparison result; fix any reported well-formedness errors.
- Copy or download the output. Validate against an application schema separately if one is required.