Skip to content

XML Formatter

Indent XML that is crammed onto one line or messy, minify it, and find structural errors by line and column.

This tool runs entirely in your browser; what you enter is never sent to our servers.

How to use it

  1. Paste your XML into the left box.
  2. Choose the indentation and press “Format” or “Minify”.
  3. Take the result with “Copy”; if there is an error, its line and column are shown.

What it checks

The tool checks that the XML is well formed: every tag that opens closes with the same name, tags nest in the right order, and the document has a single root element. If something is wrong, the line and column of the first error are shown. Formatting keeps attributes, quotes, comments, CDATA sections and escapes such as & exactly as written; only the whitespace between tags changes. Definitions inside a DOCTYPE are never resolved and no outside file is fetched. There is no schema (XSD or DTD) validation, so a well-formed document may still not match a particular schema.

Frequently asked questions

Help us improve this tool