XML Formatter

Format and minify XML for readability and validation.

Input data is processed in your browser
Data is never sent to a server

Tool

0 chars

What is XML Formatter?

XML Formatter reformats compact or poorly indented XML into a clean, readable structure. It can also minify XML by removing whitespace and line breaks, and validates syntax in the process. Useful for inspecting configuration files, API responses, and SOAP messages.

How to Use

  1. Paste XML text into the input field.
  2. Click "Format" to pretty-print with proper indentation.
  3. Click "Minify" to remove all whitespace and line breaks.
  4. Click "Copy Result" to copy to clipboard.

FAQ

Is the XML declaration (<?xml ...?>) preserved?

Yes. Any XML declaration in the input is kept at the top of the formatted output.

What happens if I enter invalid XML?

A parse error message is displayed. Check for issues such as unclosed tags.

How are empty elements represented?

With "Self-close empty elements" enabled, empty elements use the <tag /> form; otherwise they use <tag></tag>.

Is my data sent to a server?

No. All processing happens in your browser using the built-in DOMParser.