XML Formatter
Pretty-print XML with proper indentation to make it readable, or minify it down to remove unnecessary whitespace — with clear errors if the XML is malformed.
Everything you enter is processed in your browser and isn't sent to our servers.
How to use xml formatter
- 1Paste your XML.
- 2Click Pretty print for readable, indented output, or Minify to compress it.
- 3Copy the result or download it as a .xml file.
About this tool
Pretty printing adds consistent indentation so nested elements are easy to read at a glance — useful when you're handed a single-line XML response from an API or log file. Minifying does the opposite: it strips whitespace between tags to produce the smallest valid representation of the same document.
Both operations parse the XML into a structure first, so a malformed document (like a tag that's never closed, or mismatched opening/closing tags) is caught and reported clearly rather than producing garbled output.
Frequently asked questions
No — pretty printing and minifying only change whitespace between tags (indentation, line breaks). The elements, attributes and text content are preserved exactly; only the surrounding formatting changes.
Related tools
XML to JSON Converter
Convert XML to JSON, with a documented attribute/text convention.
JSON Formatter
Format, minify and validate JSON instantly.
Diff Checker
Compare two texts and see line-by-line differences.
CSV to JSON Converter
Convert CSV data to JSON, with proper quoted-field handling.
JS Minifier
Minify JavaScript to reduce file size.