XML Formatter

Pretty Print and Validate XML.

Loading…

XML from an API or a config export usually comes without a single line break. Formatted, the nesting is visible at a glance, and a missing closing tag is easy to find.

The formatter parses the document first. If a tag isn't closed or an attribute lacks quotes, you get the parser's error message. Minify does the reverse and strips whitespace between tags to make the file smaller.

How to use the XML Formatter tool

  1. Paste the XML, or open an .xml file.
  2. Choose the indent, or tick minify.
  3. Copy the tidy XML or save it as a file.
  • Reading API responses, RSS feeds and SOAP messages
  • Checking a sitemap or a config file before deploying
  • Shrinking XML for transfer

Tips for the best result

  • It also works on SVG, RSS, XSD, plist and other XML-based files.
  • An error message means the XML is broken, which is often the thing you were trying to find out.

Quick facts

PriceFree
Works withXML
Where it runsIn your browser, on your device
AccountNot needed

Frequently asked questions

What does well-formed mean?

Every tag is closed, tags are nested properly, attribute values are quoted and there is one root element.

Does it validate against a schema or DTD?

No. It checks syntax only.

Are comments and CDATA kept?

Yes. Both are preserved.

Why did the spacing inside my text change?

Whitespace at the start and end of text is trimmed when indenting. Text inside CDATA is left exactly as it was.