XML Formatter

Format, beautify, minify and validate XML with clear error messages and adjustable indentation.

Tool

Was this tool useful?

About this tool

About XML Formatter

Make XML files, feeds and API responses readable, or minify them to save space. Invalid XML is reported with the line where the problem is.

How it works

XML is parsed with the browser’s DOMParser; formatting rebuilds the tree with your chosen indentation.

Example

<a><b>1</b></a> becomes a neatly indented three-line document.

How to use this tool

  1. Paste your XML.
  2. Click Format, Minify or Validate.
  3. Copy or download the result.

Frequently asked questions

Is my code uploaded?

No. Everything runs in your browser, so your code and data stay on your device.

Does it keep comments and CDATA?

Yes, comments, CDATA sections and processing instructions are kept.

Does the XML Formatter send my data to a server?

No. The XML Formatter runs entirely in your browser using JavaScript, so tokens, code and data you paste stay on your device. You can even use it offline once the page has loaded.