Skip to content
WebKitool

XML Formatter & Minifier

Indent XML to reveal its structure, or minify it back to a single line.

Loading tool…

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

  1. Paste your XML.
  2. Choose Format or Minify, and an indent width.
  3. 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>&lt;?xml …?&gt;</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