jsonecho

XML Formatter

Paste minified or messy XML and get it indented and checked in one step.

Loading the tool...

How to use XML Formatter

  1. Paste your XML or upload a file.
  2. Pick the indent and decide whether to drop comments.
  3. Copy the formatted XML, or open the Tree view to explore it.

About XML Formatter

XML from a web service or an old export usually arrives on one line. This formatter puts every element on its own line and indents children under their parents, so the structure is visible again. Text-only elements stay on a single line, <name>Mira</name>, which keeps the output compact.

Before formatting, the XML is checked for well-formedness. If a tag is not closed, or the nesting is wrong, you see the line and column and a message, instead of a half-formatted result you cannot trust.

Frequently asked questions

Does formatting change the meaning of my XML?

In most documents, no. Whitespace between elements is ignored by almost every consumer. The exception is mixed content, where text sits between tags, in which case extra whitespace can matter. If your XML is that kind of document, check the result.

Does it keep comments, CDATA and the XML declaration?

Yes. Comments are kept unless you tick Remove comments, CDATA sections and processing instructions are left untouched.

What does "well formed" mean?

Every opening tag has a closing tag, tags are nested properly, attribute values are quoted, and there is exactly one root element. It does not mean the document follows a particular schema.

Can it format SOAP or WSDL?

Yes, both are just XML. There are dedicated pages for them as well, if that is what you searched for.

Is there a size limit?

There is a generous limit. Files of several megabytes format without trouble.

More in XML Tools

All tools →