XML Formatter Online

Paste flattened or badly indented XML and get it back with each element on its own line and nesting you can actually follow.

Output

How to use

  1. Paste the XML you want readable.
  2. The indented version appears alongside.
  3. Copy the formatted document.

Frequently asked questions

Does indenting change the document?

It adds whitespace between elements. For most XML that is insignificant, but if your schema declares mixed content, the added whitespace is part of the content.

What about CDATA sections?

They are left exactly as they are. Reformatting inside CDATA would change the data, which is the whole reason the section exists.

Will attributes be reordered?

No. Attribute order carries no meaning in XML but reordering makes diffs noisy, so they stay as written.

Can I go back to a single line?

That is minifying rather than formatting. Format while you are reading the document, and strip the whitespace again before sending it over the wire.

Last updated

Powered by maratool