Skip to content
Jellykit

XML Formatter

Format and pretty print XML with clean indentation. Comments, CDATA and the declaration are kept, and malformed XML is reported by line. Free, in your browser.

Runs in your browser. Nothing is uploaded.

About XML Formatter

XML Formatter re-indents XML so the structure is readable: one element per line, children nested under their parents, and short elements such as <title>Dune</title> kept on a single line. Comments, CDATA sections, processing instructions and the <?xml ?> declaration are preserved.

The XML is checked for well-formedness first, so a missing closing tag is reported with its line and column instead of producing garbled output. Attribute values and text are never changed, only whitespace between tags.

It works for SOAP responses, sitemaps, RSS feeds, Android layouts, Maven pom.xml files and SVG markup, and nothing you paste leaves your device.

How to use XML Formatter

  1. Type or paste your text into the input box. Press Sample to see an example.
  2. Adjust the options. The result updates as you type.
  3. Copy the result, or press Use as input to chain another transformation.

Frequently asked questions

Does formatting change my data?

No. Only whitespace between tags is changed. Text content, attributes and CDATA are left exactly as they were.

Can it format a one-line XML file?

Yes, that is the most common use. Minified XML from an API is expanded into indented lines.

Is XML Formatter free and private?

Yes. XML Formatter is completely free with no sign-up. Everything runs in your browser, so whatever you type or paste never leaves your device.

See all data tools →