XML formatter

Paste XML to check its tags and get an indented version.

XML formatter

Documents up to 1 MB are supported.

Result

Formatted XML
<catalog>
  <book id="1">
    <title>XML</title>
  </book>
</catalog>
Elements
3

How it is calculated

  1. Opening and closing tags are checked, along with the single root element.
  2. Nested elements are indented by two spaces.
  3. Mixed content is kept without rearranging its text.

Example

<catalog><book id="1"><title>XML</title></book></catalog>

Good to know

  • The check covers tag structure; it does not validate a DTD or XSD schema.
  • Documents larger than 1 MB are not accepted.

When to use it

  • Make a one-line XML export readable before checking it.
  • Format a sitemap or an RSS feed to read its entries.
  • To check that the file is well formed, use the XML editor and validator.

Frequently asked questions

Does formatting change the meaning of XML?

Usually not, but spaces inside elements with mixed text can matter. Keep the original when whitespace is significant.

What is the line starting with <?xml?

The XML declaration: it gives the version and often the encoding, such as UTF-8. It must be the very first thing in the file.

What is CDATA?

A section, written <![CDATA[ … ]]>, whose content is read as plain text. It lets you include < and & without escaping them.

Updated October 11, 2026

Indicative result. For an important decision, check with a professional.