Skip to content

XML Formatter

Pretty-print or minify XML with proper indentation.

Last updated August 26, 2026

Data

About this tool

XML from API responses, SOAP payloads, or config files is often returned as a single unbroken line, making it hard to read or debug. This tool pretty-prints XML with consistent 2-space indentation based on tag nesting, validates that it's well-formed, and can also minify it back down to a single line for compact storage or transmission.

Frequently asked questions

Does this validate against a specific XML schema (XSD)?

No — it checks that the XML is well-formed (properly nested and closed tags, valid syntax) but doesn't validate against a custom schema or DTD.

What happens to self-closing tags like <br/>?

They're preserved as self-closing and indented at their current nesting depth, without adding a separate closing tag.