XML pretty print

Choose indentation, then paste valid XML to make it easier to read.

XML pretty print

Documents up to 1 MB.

Result

Formatted XML
<message>
  <to>Ada</to>
  <body>Hello</body>
</message>
Elements
3

How it is calculated

  1. Tags are checked and nested elements are indented using your choice.
  2. Indentation does not change attribute values.
  3. Mixed content is left as is to preserve its text.

Example

<message><to>Ada</to><body>Hello</body></message>

Good to know

  • Does not validate a DTD or XSD schema.
  • Documents larger than 1 MB are not accepted.

When to use it

  • Indent an XML response from a web service before reading it.
  • Prepare a readable XML extract for a document or a ticket.
  • To edit and check the file, use the XML editor and validator.

Frequently asked questions

How do I write & or < in XML text?

Use the entities &amp; and &lt;. The others, &gt; &quot; and &apos;, are needed in some places, such as inside attributes.

What is a namespace?

A prefix such as xsi: tied to a URI, so that tags from different vocabularies do not clash. The URI is a name, not always a page you can open.

Is pretty XML bigger?

Yes, indentation adds characters. For storage or sending, the compact version is lighter; compression removes most of the gap.

Updated October 11, 2026

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