XML Formatter & Validator

Link copied

Paste any XML to pretty-print it with your choice of indentation, minify it to a single compact line, or check that it is well-formed — all in your browser. The formatter understands declarations, comments, CDATA sections, processing instructions, and attributes, and keeps mixed content intact so your markup is never corrupted. When the XML is malformed, you get a clear message and the exact line and column of the problem, so you can fix it fast. Free, fast, and runs entirely on your device — your data never leaves your browser.

Input
Output
Formatted output appears here.

How to use

Paste or type XML into the input box. Choose an indent width, then click Pretty-print to indent it or Minify to collapse it to one line. Well-formed XML shows formatted output you can copy; malformed XML is flagged with the underlying problem and its line and column.

Frequently asked questions

Is the XML formatter free?
Yes. It's completely free, needs no sign-up, and runs entirely in your browser.
What does well-formed mean, and what does the validator check?
Well-formedness is the structural correctness XML requires: every start tag has a matching end tag, tags are properly nested, attribute values are quoted and not duplicated, there is a single root element, and comments, CDATA, and processing instructions are terminated. The tool checks all of these and points to the exact line and column of the first problem. It does not validate against a DTD or XML Schema.
Does my XML get uploaded anywhere?
No. All parsing, formatting, and validation happen locally in your browser — your data never leaves your device.