
XML is still how many systems exchange data: SOAP services, sitemaps, invoices, feeds, configuration files and a good share of banking and government interfaces. It is often delivered as one long line that no one can read. The tool below formats XML with indentation and tells you whether it is well-formed. It runs in your browser, so the document you paste is not sent anywhere.
XML formatter and validator
Check that XML is well formed and lay it out with indentation.
What you enter never leaves your browser. Nothing is sent or stored.
How to use the tool
- Paste your XML into the input field.
- Press Format. Validate runs the same check.
- If the XML is well-formed, the result is shown indented, with each nested element on its own line. If it is not, the tool shows the browser's parser error instead.
The check uses the XML parser built into your browser. That is a check for well-formedness, which means the document follows the basic rules of XML. It does not check the document against a schema (XSD) or a DTD, so it cannot tell you whether the content is what a particular system expects.
Mistakes it finds
- A tag that is not closed or is closed in the wrong order.
<a><b></a></b>is not valid XML. - A character that must be escaped. A bare
&or<inside text has to be written as&or<. - More than one root element. A document has exactly one outermost element.
- Attribute values without quotes.
<item id=5>must be<item id="5">. - Case differences.
<Item>and<item>are different elements, and the closing tag must match exactly.
Things to watch
- Formatting adds whitespace between tags. For data records this is harmless. In text-heavy documents where text and tags are mixed, extra line breaks and spaces can change how the text reads. Do not use the formatted version where whitespace matters.
- Well-formed is not valid. Passing the check does not mean the receiving system will accept the document. Required elements, data types and ordering come from the schema.
- Large files. A very large document is limited by your browser's memory.
Where it comes up
Debugging an integration, reading a response from a legacy service, checking a sitemap or a feed, or tidying a configuration file before a review. If the XML interfaces in your company are brittle, or you are connecting old systems to newer ones, we can help with system integration services and product modernization.
Frequently asked questions
Does my XML leave my browser?
No. Parsing and formatting happen in the page on your device. Nothing is sent or stored.
What is the difference between Format and Validate?
In this tool both parse the document with the browser's XML parser. Valid input gives formatted output, invalid input gives the error message. Validation here means well-formedness only.
Does it validate against an XSD or DTD?
No. It checks that the XML is well-formed, not that it follows a particular schema. Use a schema validator for that.
Why did my formatted XML change?
Formatting rewrites the whitespace between tags, and the browser writes the document back out itself, so small details such as how an empty element is written can differ from your original. The data in the elements and attributes stays the same.
Can I convert XML to JSON with it?
No. This tool formats and checks XML. It does not convert it to another format.
Related services
Where this topic becomes an engagement.
Keep reading
The articles that follow this one.



