XML Formatter & Validator — Pretty Print or Minify XML

Indent, minify and validate XML, with the exact line and column of any well-formedness error. Free, no sign-up, and your files never leave your device.

Free, with no sign-up and no watermark. The file is processed in your browser and never uploaded.

Indent messy XML so its structure is clear, or minify it for production. Before formatting, the XML is checked for well-formedness, and any problem — a tag that isn't closed, a stray & — is reported with line and column. Comments, CDATA sections and processing instructions are preserved.

Step by step

  1. Paste or open XML: Works with .xml, .svg, .xsd, .rss and similar files.
  2. Choose Beautify or Minify: Beautify indents with 2 or 4 spaces or tabs; Minify strips whitespace between tags and comments.
  3. Check validity: A tick confirms the XML is well-formed; otherwise the error shows where.
  4. Copy or download: Save the result as formatted.xml.

Handy for

Reading API responses

Make SOAP or REST XML readable.

Cleaning SVG

Format SVG files to edit them by hand.

Sitemaps and feeds

Check that a sitemap or RSS feed is well-formed.

Smaller files

Minify XML before shipping it.

Good to know

  • Elements that contain only text stay on one line, e.g. <to>Team</to>.

  • Well-formed doesn't mean schema-valid: the tool checks XML syntax, not an XSD or DTD.

Questions

Does minifying change my data?

It removes whitespace between tags and comments. Text inside elements is kept. If whitespace between elements matters to your application (rare), keep the formatted version.

Is my data sent anywhere?

No. Everything is processed by JavaScript in your browser tab — nothing you paste or open is uploaded, logged or stored on a server. You can even use the tool offline once the page has loaded.

More Developer Tools tools

All Developer Tools tools