XML Formatter & Validator
Indents XML and reports the line and column of the first well-formedness fault.
Indents an XML document — a SOAP envelope, an RSS feed, an SVG, a `.xsd` — and reports whether it is well-formed while doing so. Well-formed means the tags match, the attributes are quoted and every namespace prefix is declared; it does not mean the document satisfies your schema.
XML in
Drop an XML file
Read in this tab. Nothing is uploaded.
Formatted
Elements
10
Attributes
8
Depth
5
In
361 byte
Out
428 byte
This checks that the document is well-formed — tags match, attributes are quoted, namespace prefixes are declared — and it does not validate against a DTD or an XSD. An element that is well-formed can still be in the wrong place for your schema, and this will not tell you so. An element containing both text and child elements is left on one line: reindenting it would insert whitespace into your content.
How to use it
Paste or drop the document
XML, SVG, XSD, RSS and Atom are all accepted. The stats line counts elements, attributes and nesting depth as you type.
Set the indent, or minify
Two spaces, four, or a tab; or flip to Minify when the document is going over a wire that charges by the byte.
Sort attributes when you are diffing
XML gives attribute order no meaning, so two documents that differ only in it produce a noisy diff. Sorting them makes the real difference visible.
Read the problems, if there are any
Errors and warnings come with a line and column. The document is still formatted as far as it can be, so you can find the fault by looking at where the output stops making sense.
Common questions
Does it validate against my XSD or DTD?
No. It checks well-formedness only. An element that is perfectly well-formed can still be in the wrong place, have the wrong cardinality or carry the wrong type for your schema, and nothing here will tell you so.
Why was one element left on a single line?
Because it contains text and child elements together — `<note>Deliver <em>before</em> Friday</note>`. Indenting that would insert whitespace into your content, and in mixed content whitespace is content.
Can I format an SVG with it?
Yes — an SVG is XML, and path data lives in an attribute so it is never reflowed. For editing the path itself, the SVG path tools are the right page.
Does it expand entities from a DTD?
No. Only the five XML predefines are understood; a custom entity declared in an internal or external DTD subset is left as written. Resolving external ones would mean fetching a URL, which this page does not do.
Feed it from
JSON ⇄ XML
Converts between JSON and XML with configurable handling of attributes, arrays and text nodes.
XPath Tester
Evaluates an XPath or CSS selector against XML or HTML and lists every matched node.
e-Tax Invoice XML Parser
Opens NTS e-tax invoice XML files (or a zip of them) into a table of supplier, buyer, items and tax, and checks that the items, totals, VAT rate and business numbers agree.
JSON Formatter & Validator
Pretty-prints, minifies and validates JSON, pointing at the exact line and column of a syntax error.
Next
These accept what this tool produces, so the result can go straight in.
JSON Formatter & Validator
Pretty-prints, minifies and validates JSON, pointing at the exact line and column of a syntax error.
JSON ⇄ XML
Converts between JSON and XML with configurable handling of attributes, arrays and text nodes.
e-Tax Invoice XML Parser
Opens NTS e-tax invoice XML files (or a zip of them) into a table of supplier, buyer, items and tax, and checks that the items, totals, VAT rate and business numbers agree.
XPath Tester
Evaluates an XPath or CSS selector against XML or HTML and lists every matched node.
Base64 Encoder & Decoder
Encodes and decodes Base64 and Base64URL for text or files, handling UTF-8 correctly.
curl to Code
Converts a curl command into fetch, axios, Python requests, Go, PHP or PowerShell.