XML Formatter
XML Formatter
Paste XML below to pretty-print it with clean indentation, and check whether it is valid XML.
No XML handy?
About the XML Formatter
Turns messy, minified, or single-line XML into clean, indented, readable markup (pretty printing), and can also minify it back. Useful for developers reading API responses, RSS feeds, sitemaps, SOAP messages, and config files.
How to use
- Paste your XML into the input box.
- Choose Format and pick an indentation (2 spaces, 4 spaces, or tabs); or choose Minify to compress it to one line.
- Copy the formatted output.
Key features
- Pretty printing puts each element on its own line, indented under its parent, without changing the data — only whitespace between tags changes.
- Validates well-formedness while formatting and reports the line and column of the first error, such as a missing closing tag.
- Preserves attributes, comments, text values, and CDATA sections; runs in the browser with no upload.
Frequently asked questions
Does formatting change my XML data?
No — element names, attributes, and text stay the same; only the whitespace between tags is adjusted, so parsers treat formatted and minified XML as the same document.
What is the difference between formatting and minifying?
Formatting adds indentation and line breaks for humans to read; minifying strips them to make the file as small as possible for transport or storage.
Free to use, no signup needed. This tool runs entirely in your browser — your data never leaves your device.
