XML Formatter
Pretty-print XML with configurable indentation, preserving attributes, comments, and tag order.
How it works
- 1
Paste your XML into the input area — minified, poorly indented, or already structured.
- 2
Choose an indent width (default is 2 spaces) and press Format XML.
- 3
Copy the result or download it as formatted.xml. Nothing leaves your browser.
Questions
Does the formatter change my data?
No. It only adjusts whitespace and indentation. Tag names, attribute values, comments, and text content are preserved exactly.
What happens with an XML declaration?
Declarations like <?xml version="1.0"?> are kept at the top of the output unchanged.
Is my XML uploaded anywhere?
No. Formatting happens entirely in your browser — nothing you paste is sent to any server.
Can it handle large files?
Yes, within the memory limits of your browser tab. Very large documents may take a moment.
More developer tools
JSON Formatter
Paste compact or messy JSON and get it back neatly indented with your chosen spacing.
JSON Minifier
Remove all whitespace and line breaks from a JSON document to shrink it as small as possible.
JSON Validator
Check whether a JSON string is well-formed, and see the exact line and column of any syntax error.
JSON Beautifier
Reformat JSON with sorted keys and readable indentation for easier reading and diffing.
JSON Tree Viewer
Explore a JSON document as an interactive collapsible tree — expand and collapse any node.
XML Validator
Check XML for well-formedness and report every error with its line and column number.
YAML Formatter
Normalize and re-indent YAML, or convert it to JSON, with a configurable indent width.
Markdown Preview
Render Markdown as formatted HTML with GFM tables and task lists, updating live as you write.