XML Formatter

Make XML readable, find where it's broken, and query it with XPath.

How to format XML

  1. Paste XML or open a file.
  2. Pick indentation, comments, attribute layout — or type an XPath query.
  3. Copy or download the formatted XML.

About XML Formatter

Format, beautify, minify and validate XML.

Everything works in your browser, so it is instant and private, and your settings are remembered on this device.

Good for

  • Reading SOAP and API responses
  • Cleaning up SVG, sitemaps and RSS feeds
  • Editing Android, Maven and .NET config files

Tip: Use “One attribute per line” for SVG and Android layouts with many attributes.

Frequently asked questions

How do I format XML?

Paste XML or open a file — it is indented instantly. Choose 2 or 4 spaces, tabs or Minify, and copy or download the result.

Does it check if my XML is valid?

It checks that the XML is well-formed (properly nested and closed tags, quoted attributes, escaped characters) and shows the exact line and column of the first error.

Can I run XPath queries?

Yes — type an XPath such as //book[price > 10]/title and the matching nodes appear in the XPath tab.

Is mixed content kept?

Yes — elements that mix text and tags (like a paragraph with a bold word inside) are kept on one line so no spaces are added to the text.

Is my data uploaded?

No. Everything is processed by JavaScript in your browser — nothing you paste or open is sent to a server, so it is safe for API responses, tokens, configs and customer data. It also works offline once the page has loaded.

Related tools

← Back to all tools