convert

XML Formatter

Pretty-print or minify XML and catch mismatched or unclosed tags with exact line numbers.

Runs on your deviceBatch readyPaste textNew

Paste or drop

Paste text below, or drop a file instead.

0 chars · 0 lines
…or drop a file
Drag and drop, or choose files
XMLTXTSVGRSSATOMPLIST

Choose an output

Pretty-print or minify XML and catch mismatched or unclosed tags with exact line numbers.

Fine-tune

Optional — sensible defaults are already set.

Mode
Indent

About XML Formatter

This tool parses XML and either beautifies it with 2 spaces, 4 spaces or tabs, or minifies it by removing whitespace between tags. Because it parses the document first, mismatched or unclosed tags are reported with the line where the problem was found.

When it helps

  • Reading a SOAP response, SAML assertion or API payload that arrived as a single line.
  • Tidying an SVG, RSS feed or Android resource file before committing it.
  • Minifying an XML config or sitemap to reduce its size.
  • Locating the unclosed tag that makes a parser fail.

Tips

  • Comments, CDATA sections, processing instructions and the DOCTYPE are preserved in the output.
  • Beautifying adds indentation whitespace. In formats where whitespace inside mixed content is significant, such as some XHTML or DocBook text, check the result.
  • .plist files in XML form can be formatted here. Binary plists cannot, since they are not XML.

Good to know

Quick answers about xml formatter in your browser.

No. It checks that the document is well-formed, meaning tags are properly nested and closed. It does not validate against an XSD or DTD.

XML requires every opening tag to be closed by a tag with exactly the same name, in the reverse order it was opened, and names are case-sensitive. <Item> closed by </item> is an error.

Yes. There is no sign-up, no watermark and no limit on how many files you process.

No. Files are read and processed locally in your browser, so they never leave your device.

Related tools