XML Formatter & Validator
Pretty-print, minify and validate XML.
Runs in your browser. Nothing you open or type here is uploaded.
How to use
- Paste your XML into the input field.
- Choose an indent width.
- Format to pretty-print it, Minify to remove whitespace, or Validate to check it.
- Copy the result from the output field.
Details
Formatting reparses the document and writes it back with consistent indentation and line breaks, which makes nested XML readable. Minify does the opposite: it strips indentation and unnecessary whitespace to make the file as small as the format allows. Validation checks well-formedness only — matching tags, proper nesting, valid entities and exactly one root element — and reports the first error it finds. It does not check the document against a DTD or schema.
- Well-formed is not the same as valid: a document can pass here and still break the rules of a specific XML format.
- Minified XML is what you ship; formatted XML is what you read. Keep the formatted copy for editing.
Common questions
What happens to my XML?
Everything runs locally in your browser — your XML is never uploaded to any server.
What does validation check?
Well-formedness: matching tags, proper nesting, valid entities, and a single root element. The first error found is reported.
Format vs. Minify?
Format adds indentation and line breaks for readability. Minify strips all unnecessary whitespace for the smallest file size.