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
- Paste your XML into the input field
- Click Format to pretty-print with indentation
- Click Minify to collapse all whitespace
- Copy the result using the Copy button
Common use cases
- Formatting minified XML API responses for review
- Cleaning up poorly indented XML configuration files
- Compressing XML before storage or transmission
- Inspecting XML from SOAP API responses
- Formatting RSS or Atom feed XML
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.