XML Formatter & Minifier
Indent XML to reveal its structure, or minify it back to a single line.
Processing: This tool runs entirely in your browser. Your input and any file you open stay on your device — nothing is uploaded to a server.
How to use the xml formatter & minifier
- Paste your XML.
- Choose Format or Minify, and an indent width.
- Copy or download the result.
About this tool
XML from an API or a config export usually arrives as one line. Indenting it makes the nesting visible, which is normally all you need to find the element you are after.
Declarations (<code><?xml …?></code>), comments and CDATA sections are preserved exactly, self-closing tags stay self-closing, and elements containing only text stay on one line. Nothing is validated against a schema and no entities are resolved — this is a readability pass, not a parser.
Common uses
- Reading an XML API response.
- Inspecting an RSS feed or sitemap.
- Tidying a configuration file before editing it.
Frequently asked questions
- Does it check that my XML is valid?
- No. It indents whatever you give it. Malformed XML will produce odd indentation rather than an error — that mismatch is often a useful hint about where the problem is.
- Are CDATA sections safe?
- Yes. CDATA blocks and comments are copied through unchanged.
Related tools
HTML Formatter & Minifier
Indent messy or minified HTML so it can be read, or strip it back down to one line.
JSON Formatter
Format, validate and minify JSON with clear error messages that point at the exact position.
JSON ↔ YAML Converter
Convert JSON to YAML or YAML back to JSON, in either direction, with indent control.
CSS Formatter & Minifier
Format CSS with one declaration per line, or minify it for production.