XML Formatter
Validate and pretty-print XML, in your browser.
Paste XML to validate and pretty-print it
Paste XML on the left and click Format. Malformed XML is flagged with the parser error; well-formed XML is indented cleanly — all in your browser, nothing uploaded.
Runs entirely in your browserFormat and validate XML, locally
Paste XML and this tool checks it is well-formed and re-indents it into clean, nested output. If something is wrong — an unclosed tag, a stray character, mismatched elements — it shows the parser's error so you can fix it. Elements with a single text value stay on one line, while nested structures are indented at the width you choose. It uses the browser's own XML parser, so everything runs on your device and nothing is uploaded to any server.
Common questions
What does the validator check?
Well-formedness: that tags are properly opened and closed and nested, attributes are quoted, and the document has a single root. It uses the browser's built-in XML parser, the same one your browser uses for real XML.
Does it check against a schema (XSD/DTD)?
No. It checks that the XML is well-formed, not that it is valid against a specific schema. Schema validation needs the schema itself and is beyond a quick client-side tool.
How is the XML indented?
Nested elements are indented at your chosen width (2 or 4 spaces, or a tab). An element whose only content is text is kept on one line for readability, e.g. <name>Ada</name>.
Are comments and CDATA preserved?
Yes. Comments and CDATA sections are kept in the formatted output; only insignificant whitespace between elements is normalized.
Is my XML uploaded anywhere?
No. Parsing and formatting happen entirely in your browser tab using the native DOMParser. Nothing is sent to a server, so it works offline and your data stays private.