Toollance

XML Formatter

Format and minify XML online. Pretty-print XML with proper indentation or collapse it to a single line for compact transmission.

Output

What does this tool do?

The XML Formatter pretty-prints XML with consistent 2-space indentation, making it easy to read and review. It also includes a Minify option to collapse whitespace for compact storage or transmission.

How to use this tool

  1. Paste your XML into the input field
  2. Click Format to pretty-print with indentation
  3. Click Minify to collapse all whitespace
  4. Copy the result using the Copy button

Common use cases

Example

Input: <root><item id="1"><name>Example</name></item></root>

Formatted output:

<root>
  <item id="1">
    <name>Example</name>
  </item>
</root>

Notes

This tool performs basic tag balance validation and will report mismatched or unclosed tags.

Privacy

All processing happens in your browser. Nothing is transmitted.