XML Formatter
Pretty-print or minify XML with proper indentation.
Last updated August 26, 2026
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.
More in Data & Code
Format, minify, and validate JSON with clear error messages.
Convert CSV data to JSON, with or without a header row.
Convert JSON arrays, objects, and API responses into spreadsheet-ready CSV. Flatten nested fields, choose how arrays are handled, preview the columns, and download the result — all in your browser.