Search tools

XML Formatter

Indent XML for reading or minify it for transport — and catch well-formedness errors on the way.

XML Formatter tool

Options

Processing runs in your browser.

XML from SOAP services, feeds, sitemaps and configuration exports is often a single long line, and a missing closing tag somewhere in it can be impossible to find by eye. Formatting shows the structure, and the validator points straight at errors.

Uses

  • SOAP and enterprise APIs: read responses during debugging.
  • Sitemaps and RSS feeds: check they’re well-formed before submitting.
  • Config files: tidy Maven, .NET or Android XML.
  • SVG: inspect and tidy hand-edited graphics.

Why well-formedness matters

A single unclosed tag or unescaped ampersand makes an entire XML document unreadable to strict parsers: a sitemap is rejected by search engines, a feed stops updating, or an API call fails. Checking well-formedness before you publish or send XML catches these mistakes early, with the exact line to fix.

How to use the XML Formatter

  1. Paste XML or open an .xml, .svg or .rss file.
  2. Choose Format or Minify, and the indent size.
  3. Fix any error shown with its line and column.
  4. Copy or download the result.

Features

  • Validates well-formedness before formatting.
  • Keeps comments, CDATA sections, processing instructions and the DOCTYPE.
  • Short elements like <title>Dune</title> stay on one line.
  • Minify mode removes whitespace between tags and comments.

Frequently asked questions

Does formatting change my XML data?

It adds or removes whitespace between tags. That’s safe for nearly all XML, but in mixed-content documents where whitespace inside text matters, check the result.

Does it validate against an XSD schema?

No. It checks well-formedness — matching tags, quoted attributes, one root — not schema rules.

Can I format SVG files?

Yes. SVG is XML. For making SVGs smaller, the SVG Optimizer does more than whitespace removal.

Written by