Skip to content

Developer Tools

XML Formatter & Validator

Pretty-print, minify and validate XML documents.

xml formatterRuns in your browserUpdated 2026-09-22

XML input

0 chars

Result

no output
Formatted XML appears here.

About XML Formatter

XML still powers a large amount of enterprise integration: SOAP services, sitemaps, RSS feeds, SSO metadata, build files and configuration of every vintage. Those documents are frequently delivered as a single unbroken line.

This formatter parses your document with the browser XML parser and re-serialises it with consistent indentation. If the document is not well formed, the parser error is surfaced so you can fix it rather than guess.

How it works

  • Input is parsed with the DOMParser using the XML MIME type, so malformed markup is rejected.
  • The parsed tree is serialised again with either indentation or all whitespace removed.
  • Attribute order and comments are preserved, while structure comes back in a readable shape.
  • Parser errors are displayed verbatim, including the reason reported by the browser.
  • The output pane shows the full document, ready to copy or download.

Input and output

Accepts

An XML document, feed, sitemap or configuration file.

Produces

Indented or minified XML, or a parser error explaining what is malformed.

Privacy

Parsing happens with the browser built-in XML parser. Your document stays on your device.

XML Formatter FAQ

What does well formed XML mean?

It means every tag is closed, tags are nested properly, there is exactly one root element, and attribute values are quoted. Well formed XML can still be invalid against a schema.

Can this tool validate XML against an XSD?

No. Schema validation is not available in the browser, so this formatter only checks well-formedness.

Why is whitespace-sensitive XML risky to reformat?

In some documents, text nodes containing only spaces are meaningful. If a downstream system depends on that whitespace, keep a copy of the original before reformatting.

Does it handle large sitemaps?

Sitemaps up to a few megabytes are fine. Extremely large documents may be limited by browser memory.