XML Formatter & Validator

Indent, validate and minify XML.

XML Formatter reindents XML into readable structure, checks that it is well-formed and points at the exact failure when it is not, and can minify it back. It handles namespaces, CDATA sections, processing instructions and comments without corrupting them, entirely in your browser.

Loading XML Formatter & Validator…

Runs entirely on your device. No file or text you enter here is uploaded. How to verify it.

How to use XML Formatter & Validator

  1. Paste XML, or open a file.
  2. Format, minify, or validate.
  3. Copy the result.

Questions about XML Formatter & Validator

What does "well-formed" check?
That every tag is closed and correctly nested, attributes are quoted, there is exactly one root element, and entities are valid. It does not check the document against a schema or DTD — that is validity, a stronger and separate claim.
Is CDATA preserved?
Yes, verbatim including its internal whitespace. Reindenting the contents of a CDATA section would change the data, which is the whole point of CDATA.
Does formatting change the document?
Whitespace between elements changes, which is semantically insignificant in most XML but not all — mixed content, where text and elements share a parent, is left alone for that reason.
Does it validate against a DTD or XSD?
No. It checks well-formedness only — correct nesting, quoted attributes, one root element, valid entities. Schema validation needs the schema file and a validating parser, which is a different job from formatting.
Can it open a large XML export?
A few tens of megabytes format without trouble. The document is parsed and rebuilt in memory, so a multi-gigabyte export is more than a browser tab can hold and belongs in a streaming command-line tool.
Is XML Formatter & Validator really free, with no limits?
Yes. There is no account, no daily cap, no file-size tier and no watermark, because there is no server cost to recover. The site is funded by clearly disclosed partner recommendations on the Partners page, never by metering the tools.
Are my files or text uploaded when I use XML Formatter & Validator?
No. Everything is processed by JavaScript running in your browser, on your device. You can verify it: open your browser's developer tools, switch to the Network tab, and use the tool. You will see no request carrying your data — because there is nowhere for it to go.