XML Formatter

Format and validate XML online for free with proper indentation, in your browser.

How to use

  1. 1Paste your XML into the editor.
  2. 2Click Format to beautify it, or Minify to compact it.
  3. 3Copy or download the result.

Features

  • Format with proper indentation
  • Minify to a single line
  • Validates XML while formatting
  • Copy or download the result

Supported formats

XML

Privacy

Your XML is processed locally in your browser and is never sent to our server.

About this tool

The XML Formatter beautifies XML with consistent indentation using your browser's built-in DOMParser, making it easier to read and debug. It can also minify XML to a single compact line.

Frequently asked questions

Does this validate my XML too?

Yes, Format and Minify both check that the XML is well-formed first and show an error if it is not.

Is my XML sent to a server?

No, formatting happens entirely in your browser using the built-in DOMParser.