XML Formatter
Pretty print XML with consistent indentation and optional attribute wrapping.
Input
Result
How to use
How to format XML
Paste XML and press Format. Nested elements are indented and parse errors are reported with a message.
- Paste XML into the input editor.
- Press Format.
- Copy the beautified document.
Frequently asked questions
Does it validate XML too?
Yes. If the document is not well formed the formatting stops and the error is displayed.
Which indentation is used?
Two spaces by default, and you can switch to four spaces or tabs from the toolbar.
Related tools
XML Validator
Check that an XML document is well formed and see a clear error description.
XML Minifier
Remove whitespace between XML tags to produce the smallest payload.
XML to JSON
Convert XML into JSON with attributes and repeated elements handled sensibly.
YAML Formatter
Parse and re-serialise YAML with consistent indentation and validation.
YAML Validator
Validate YAML syntax and get a precise error when indentation or structure is wrong.
YAML to JSON
Convert YAML documents into JSON for APIs and JavaScript applications.