Try
About this tool
- Runs in
- your browser
- Your input sent to our servers
- Nothing
- Kept on this device
- nothing
More in the privacy policy.
How to use it
- 01Paste XML, open a file (.xml, .svg, .xsd, .rss and more) or drop one on the page. Or pick one under Try.
- 02Choose the indent, or tick Minify to put it on one line; Remove comments takes the comments out. The result appears as you type, once the XML is well-formed; otherwise the error shows its line and column.
- 03Copy the result or download it as a file.
Related tools
Questions
Does it validate against a schema?
No. It checks the XML is well-formed (every tag closed and nested properly, one root element, attributes quoted, entities defined) with your browser’s own XML parser. It doesn’t check the rules of an XSD schema or a DTD.
Does it change my data?
Only whitespace: between tags, and between attributes (several spaces or line breaks become one space). Text, attribute values, comments, CDATA sections and entities stay as written. An element with text beside other elements is copied exactly, so no space is lost (<p>Hello <b>world</b>!</p> stays as it is), and so is anything inside xml:space="preserve".
Why is a piece of XML I copied rejected?
A well-formed document has exactly one root element, so two elements side by side, or text outside them, is an error. A piece copied from inside a larger document may also use a namespace prefix such as soap: that was declared further up; declare it on the root (xmlns:soap="…") or paste from the top of the document.
Why does give an error?
XML knows only five named entities: < > & " and '. Others such as come from HTML and must be declared in the document’s DOCTYPE, or written as a number ( ).
How large a file can it handle?
Up to 20 MB, and up to 1,000 levels of nesting. Large documents are formatted once you stop typing.
Is my XML sent anywhere?
No. It’s formatted and checked in your browser, and a file you open is read there too. The parser doesn’t load DTDs or anything else the XML points to. It isn’t sent to our servers, put into the page address or saved.