XML pretty print
Choose indentation, then paste valid XML to make it easier to read.
Result
Formatted XML
<message> <to>Ada</to> <body>Hello</body> </message>
- Elements
- 3
How it is calculated
- Tags are checked and nested elements are indented using your choice.
- Indentation does not change attribute values.
- 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 & and <. The others, > " and ', 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.