Indent
XML Input
Formatted XML

        

What is an XML formatter?

An XML formatter adds indentation and line breaks to XML so that you can see its structure, and checks that the document is well-formed. You need it for SOAP responses, sitemaps, RSS feeds, Android layouts and config files that arrive on one line or with broken indentation.

How to format XML

  1. Paste XML into the XML Input pane, or click Sample.
  2. Click Format or Minify.
  3. For Format, select the Indent: 2 spaces, 4 spaces or a tab.
  4. Click Copy, or Download to save the file.

Why does my XML show an error?

  • A tag is not closed. Each tag needs a closing tag or />.
  • The closing tag has a different name or case: <Item>…</item>.
  • Text contains a raw & or <. Write &amp; and &lt;.
  • An attribute value has no quotes.
  • The document has more than one root element.

Frequently Asked Questions

What does an XML formatter do?

It rewrites XML with consistent indentation so that you can read the structure. It also checks the XML, and shows an error if a tag or an attribute is broken.

What is the difference between formatting and minifying XML?

Formatting adds indentation and line breaks for people. Minifying removes the spaces and comments that are not necessary, for the smallest file.

Why does my XML show a validation error?

The common causes are tags that are not closed, closing tags with a different name, raw & or < characters in text, and attribute values without quotes.

Is my XML sent to a server?

No. The tool uses the DOMParser of your browser. Your XML stays on your device.

What is XML used for?

Config files (Maven POM, Android layouts), data exchange between systems, RSS and Atom feeds, sitemaps, SOAP web services, and office files such as DOCX and XLSX.