XML Formatter and Validator: Beautify or Minify

This xml formatter and validator makes XML easy to read and checks it for mistakes. Paste XML to indent it neatly, see errors such as missing closing tags with line numbers, or minify it to one line. Copy or download the result. The HTML to Text Converter can also help you strip HTML tags and keep clean text.

XML Formatter & Validator

Beautify, minify and convert XML.

Everything runs in your browser. Nothing you enter or upload is sent to a server.

How to use the XML Formatter & Validator

  1. Paste your XML.
  2. Press Format to beautify and validate it.
  3. Press Minify for a compact version, or XML to JSON to convert.
  4. Copy or download the result.

How it works

The XML is parsed by your browser’s built-in XML parser, which reports the first error if the document is not well formed. The tree is then written out with indentation, on one line, or as JSON where attributes start with @ and repeated elements become arrays.

Example

The sample catalog formats into an indented tree, and in JSON each book becomes an object with "@id" and "title" keys inside a "book" array.

Frequently asked questions

What makes XML invalid?

Unclosed tags, mismatched names, unquoted attributes or a stray & character.

Is my XML uploaded?

No. It is processed in your browser.

Can it convert JSON to XML?

Not yet; it converts XML to JSON.

See also: JSON Formatter & Validator, HTML Formatter and Minifier.

Format and check XML

How to use it

  1. Paste your XML.
  2. Format or minify it.
  3. Fix any errors shown.
  4. Copy or download.

More questions

Does it check against a schema?

It checks that the XML is well formed.

Can it minify?

Yes. It can minify XML by removing extra spaces and line breaks.

Is my XML uploaded?

No. Everything stays in your browser on your device.

Related tools: JSON Formatter & Validator, HTML Formatter and Minifier, YAML to JSON Converter.