XML
Pretty-print messy XML with clean indentation, or minify it for transport — with validation built in.
Your XML is parsed and reformatted locally in your browser. Nothing is uploaded, logged, or stored.
Formatting happens in two steps. First the input is parsed with a strict XML parser — this doubles as validation, so malformed documents fail fast with a readable error instead of producing broken output. Then the parsed tree is re-serialized: Format mode indents each nesting level by two spaces and places every element on its own line; Minify mode removes all whitespace-only text between tags, producing the most compact representation.
Text content, attributes, comments-free structures, and the original XML declaration are preserved. Special characters are always re-escaped correctly, so the formatted output is semantically identical to the input — only the layout changes.
Need to check syntax without reformatting? Use the XML Validator. Working with JSON instead? The JSON Formatter & Validator does the same job for JSON documents.
SOAP and REST APIs often return XML as one long line. Format it to inspect nested elements, attributes, and values at a glance.
Shrink XML configuration or data files for embedding in URLs, logs, or payloads where every byte counts.
Format two XML documents consistently before comparing them, so layout differences don't hide real content changes.
Check whether XML is well-formed, with precise error location and document statistics.
Explore XML as a collapsible element tree with attributes and text highlighted.
Minify XML to a single compact representation by stripping indentation and whitespace.
Describe what you want to match and get a working regular expression with explanations and examples.
Looking for something else? Browse all tools