XML Formatter

Make XML readable with clean indentation, minify it, and check it for errors.

FreeNo sign-upPrivate — runs in your browser
—Status
0Elements
0Max depth
0Result size

How to use the XML Formatter

  1. Paste your XMLPaste XML into the left box, or open an .xml, .svg or feed file.
  2. Format or minifyFormat adds indentation; Minify removes all extra spaces. Pick 2 spaces, 4 spaces or tabs.
  3. Fix and copyIf there is an error, the line and column are shown. Otherwise copy or download the result.

Example

<catalog><book id="b1"><title>Clean Code</title></book></catalog> becomes three neatly indented lines per level.

A missing closing tag such as <title>Clean Code</book> is reported as invalid with its line and column.

Frequently asked questions

Does it check if my XML is valid?

It checks that the XML is well-formed: every tag is closed, nested correctly and properly quoted. It does not validate against a schema (XSD or DTD).

Are comments and CDATA kept?

Yes. Comments, CDATA sections, processing instructions and the XML declaration are kept when formatting. Minify removes comments.

Will formatting change my data?

Element names, attributes and text stay the same. Whitespace-only text between tags is replaced by the new indentation, and text inside elements is trimmed.

Is my XML uploaded?

No. It is processed entirely in your browser.

Popular posts from this blog

Character Counter

Speech to Text Online

Keyboard Tester