XML Formatter and Validator

XML is still everywhere: sitemaps, RSS feeds, SOAP and banking APIs, Android layouts, e-invoice and GST data exchanges, and configuration files. When it arrives on a single line, finding the element you need is painful.

Paste XML to indent it neatly, minify it for sending, or validate it. The tool uses your browser's own XML parser, so broken XML is reported with the parser's error message instead of being silently reformatted.

Format, minify and validate

Well-formed is not the same as valid against a schema

The validator checks XML syntax. It does not check the document against an XSD schema, so a well-formed file can still be rejected by a system that expects particular elements. Use the schema provided by that system, for example the GST e-invoice schema, for full validation.

How to use this tool

  1. Paste your XML: From a file, API response or feed.
  2. Choose an action: Format, Minify or Validate.
  3. Read any error: The parser's message points to the problem.
  4. Copy or download: Save the result as an .xml file.

Features

Worked examples

A one-line sitemap

A sitemap.xml arrives as a single long line.

Result: Format shows each <url> with its <loc> and <lastmod> on separate, indented lines, so you can check the dates quickly.

A broken API response

An XML payload has a <name> tag that is never closed.

Result: Validate reports the mismatched tag instead of producing misleading output.

Who it is for

Tips

Frequently asked questions

Does it check my XML against a schema?

No. It checks that the XML is well-formed. Validate against the relevant XSD schema in the receiving system for full checks.

Is my XML uploaded?

No. Formatting and validation happen in your browser.

Why did minifying remove my comments?

Minify strips comments along with whitespace to make the file as small as possible. Use Format to keep them.

Related tools