XML formatter

Format, validate and minify XML. Shows the element count and any syntax problems, with line and column numbers.

Runs in your browser ยท nothing is sentConvert & formatNew

Paste or type XML to see the result.

How to use

  1. Paste or type XML.
  2. Choose Format for readable indentation, or Minify for a compact one-line version.
  3. Copy the result, or read the line number if there is an error.

Common scenarios

Cleaning up a minified API response

Paste a one-line XML response from an API to make it readable before debugging.

Shrinking a config file for storage

Use Minify to remove whitespace before saving or transmitting an XML document.

About this tool

Paste XML to format it with consistent indentation, or switch to Minify to remove whitespace for a compact version. The tool parses the document itself (no external library) and reports the exact line and column of a syntax error, such as a mismatched tag or an unclosed attribute.

๐Ÿ”’ Your input stays in your browser and is never sent anywhere.

Frequently asked questions

Does this validate against a schema (XSD or DTD)?

No, it checks that the XML is well-formed (correctly nested tags, valid attributes, proper entities), not that it matches a specific schema.

What happens to comments and CDATA sections?

They are kept as-is. CDATA content is never parsed as markup, and comments are preserved in their original position.

Found a problem or have a suggestion? Tell us