Skip to content
dashutils

XML Formatter

Format messy XML with proper indentation, check that it is well formed, or minify it for transport.

  • Free, no sign-up
  • Runs locally in your browser
Loading tool…

Your files are processed on this device and are never uploaded to a server.

How to use the XML Formatter

  1. 1

    Paste or type your input.

  2. 2

    Choose the operation and options.

  3. 3

    Copy the output or download it as a file.

Well-formedness check

The XML is parsed with the browser's XML parser, so unclosed tags, bad nesting and invalid characters are reported before formatting.

Well-formed XML in brief

Every opening tag needs a matching closing tag (or must self-close, like <br/>), tags must close in the reverse order they opened, attribute values need quotes, and there must be exactly one root element. Characters such as & and < inside text must be written as &amp; and &lt;. The formatter checks all of this before indenting, so you see the first real error instead of mangled output.

Formatting vs minifying

Formatting adds line breaks and indentation so you can read nested structures such as SOAP responses, RSS feeds, sitemaps and Android layouts. Minifying removes the whitespace between tags to make files smaller for transfer. Neither changes the data; text inside elements is kept as it is.

Frequently asked questions

Is my data sent to a server?

No. Everything runs in your browser as you type. Nothing is uploaded or logged, so it is safe to paste API responses, tokens and private text.

Does it validate against a schema (XSD)?

No. It checks that the XML is well formed, which catches syntax errors. Schema validation, which checks allowed elements and types, needs the XSD and a validating parser.

Can I format an XML sitemap or RSS feed?

Yes. Paste the file's content and format it to inspect URLs, dates and other entries.

Why does it say my XML is invalid?

The message points to the line with the problem. The most common causes are an unescaped & in text, a missing closing tag, or a second root element.

Something not working, or missing a setting you need? Report a problem or request a tool.