Free AI Tools

View all 83 →

XML Formatter

XML is still everywhere: sitemaps and RSS feeds, SOAP APIs, Microsoft Office and Android files, SVG graphics, invoices, bank exports and countless config files. When it arrives as one unreadable line, or breaks with a vague "parse error", you need a quick way to see its structure. This free XML formatter pretty-prints any XML with clean, consistent indentation (2 spaces, 4 spaces or tabs), so nested elements line up and you can see the hierarchy at a glance. Elements containing only short text stay on a single line, like <price>9.99</price>, and attributes, namespaces, comments, CDATA sections and processing instructions such as <?xml version="1.0"?> are all preserved. It doubles as an XML validator: the input is parsed with your browser's own standards-compliant XML parser, and if anything is wrong (an unclosed tag, a mismatched name, an unescaped & or a stray character before the declaration) you'll see the parser's error message and the line where it happened, rather than a silent failure. Need it compact for an API payload instead? Minify strips whitespace between tags. The summary shows the root element and how many elements and attributes the document contains. Everything runs locally, so private feeds and exports stay on your device.

Format XML

How to format XML

  1. Paste your XML.
  2. Choose the indentation and press Format.
  3. Fix any error shown, then copy or download the result.

Common XML errors

  • Unescaped &: write &amp;.
  • Mismatched tags: names are case-sensitive.
  • Anything before <?xml ?>, even a space.
  • More than one root element.

FAQ

Does it validate against a schema (XSD)?

No. It checks that the XML is well-formed, not that it matches a specific schema.

Will formatting change my data?

Only whitespace between tags. Text content, attributes, comments and CDATA are preserved.

Can I format HTML with it?

Only if it’s valid XHTML. Ordinary HTML usually isn’t well-formed XML.

Is my XML uploaded?

No. It’s parsed in your browser.

Related on Botvana

Comments

Contact Botvana

Newsletter

One short email every Friday: the AI news that matters and one tool worth trying.

Botvana
Home About Newsletter
Home Topics Search Newsletter