Skip to content

Format XML

Indent a wall of XML into something readable, or minify it back. Comments, CDATA sections and namespaces survive intact. Nothing is uploaded.

  • Processed on your device
  • No upload, no waiting
  • No signup, no watermark
Indent

The formatted XML appears here.

How it works

1

Paste your XML

Or drop in an .xml, .svg, .rss or .xsd file. It stays on your device.

2

Pick an indent

Two spaces, four, tabs, or minified to one line.

3

Copy or download

If the XML is broken, you get the line and column instead of a result.

Frequently asked questions

Is my XML uploaded?

No. There is no upload, no server call and no logging — the formatting happens inside this page, on your own device. You can disconnect from the internet after the page loads and it keeps working. That matters here more than it looks: the things people paste into an online JSON formatter are API responses, config files and error payloads, and those routinely carry tokens, customer records and internal hostnames.

What survives formatting?

Comments, CDATA sections, processing instructions, the XML declaration and all namespace prefixes. Attribute order is kept as written. An element holding only text stays on one line, because breaking <title>Hello</title> across three lines is not prettier — and in a mixed-content document it would change what the text actually says.

Will indenting change what my XML means?

In an element that holds only other elements, no. But XML has no general rule that whitespace is insignificant — in mixed content, where text and elements sit side by side, added whitespace IS part of the text. That is why text-only elements are left on one line here rather than being split. If your document has real mixed content and whitespace matters to it, minifying is the safer operation.

Does it work with HTML?

Only if the HTML is well-formed XML — which most real HTML is not. Unclosed <br>, <img> and <li> tags, unquoted attributes and bare ampersands are all legal HTML and all invalid XML. The parser here is a strict XML parser, so it will report those as errors rather than guess. XHTML and SVG format perfectly.

What about SVG?

Yes — SVG is XML, and this is a good way to read a minified one. Paths, gradients and embedded styles all come through unchanged; only the whitespace between elements moves.

Is there a size limit?

Your device's memory rather than an upload cap. Documents of a few megabytes format instantly; very large ones are limited by how much the browser will hold, not by anything we impose.