XML Formatter
Indent XML documents while preserving their content.
Input
This tool runs entirely in your browser. The data you paste or load is never uploaded.
Result
Enter your input, then run the tool.
About this tool
Re-indents an XML document and verifies that tags are balanced. Attribute values and text nodes are left untouched, and the parser reports the first mismatched tag instead of producing a broken document.
How to use it
- Paste XML into the input panel.
- Choose the indentation width.
- Format, then copy or download the indented XML.
Frequently asked questions
Does it add or remove elements?
No. Only whitespace between tags is rewritten; text content inside elements is preserved.
What about the XML declaration?
It is kept on the first line when present. DOCTYPE and comments are preserved as-is.
Keep going
Related tools
XML Validator
Find unclosed tags and malformed markup.
JSON Formatter
Pretty-print compact or broken JSON with a readable indentation.
HTML Formatter
Indent nested HTML and make long templates readable.
JSON Validator
Check JSON syntax and see exactly where it breaks.
JSON Minifier
Strip whitespace from JSON to shrink payloads.
JSON to CSV Converter
Turn an array of JSON objects into a spreadsheet-ready CSV.