# XML Formatter Guide

Pretty-print and minify XML.

- Tool: https://ilham.dev/tools/xml-formatter/
- Guide URL: https://ilham.dev/guides/xml-formatter/
- Tool guides index: https://ilham.dev/guides/tools/
- Broader guide: Working With Structured Data (https://ilham.dev/guides/working-with-structured-data/)

## What it does

Pretty-print or minify XML at the indentation you choose. It parses the document first, so mismatched and unclosed tags are reported instead of being passed through.

## Use the tool

Open https://ilham.dev/tools/xml-formatter/, add the input the tool asks for, run it, and check the output before using it elsewhere.

## Input and output

- Input: text.
- Output: text.
- Category: Formats.

## Privacy and processing
Processing happens locally in your browser. This tool does not upload the input to ilham.dev.

## Questions

### Does it preserve CDATA and comments?

Yes. Both are kept as they are; only the whitespace between elements changes.

### Why does it refuse my file?

The parser is strict. A stray ampersand, an undeclared namespace prefix or a mismatched tag will stop it, and the error names the position.