# XML formatter

Format, beautify and validate XML in your browser. Broken XML gets the line and column that broke it, not just the word invalid. Nothing is uploaded.

Canonical page: https://filetity.com/xml-formatter

## Capabilities

- Free: Yes, with no watermark and no page limit.
- Account required: No. There is no account system.
- Processed on device: Yes. The file is read by your browser and never uploaded. There is no server to send it to.
- Formats: XML in, including declarations, DOCTYPE, comments and CDATA. Formatted XML out, or minified.
- Limits: Formats and validates that the document is well-formed. It does not check against a DTD or an XSD schema.
- Mobile: Yes, on any modern mobile browser. Large files are limited by the memory the phone gives the browser.
- Offline: Yes, after you have used it once. Your browser keeps what the tool needs, so it then works with no network connection.

## Questions

### Is my XML uploaded to a server?

No. The parser runs in your browser and there is no server to send it to. That matters here more than on most tools, because the XML people need formatted is usually an API response, an invoice or a config file they are not allowed to paste into a random website.

### What does 'well-formed' mean, and is it the same as valid?

Well-formed means the syntax is right: every tag closes, they nest in the right order, and the special characters are escaped. Valid means it also matches a schema that says which elements are allowed where. This page checks the first, which is what catches almost every real error.

### Why does it say the line and column?

Because the reason anyone opens a formatter with broken XML is to find the character that broke it. A message saying only 'invalid' sends you back to reading the file by eye.

### Can it minify as well as beautify?

Yes. Choose Minified as the indent and the whole document comes back on one line, which is what you want before putting XML into a request body or a config value.

### Are comments, CDATA and the XML declaration kept?

Yes, all three, along with a DOCTYPE. They are passed through as written, on their own line at the current indent, and the contents of a CDATA section are never touched, so a < inside one is not read as a tag.

## Related tools

- [JSON Formatter and Validator](https://filetity.com/json-formatter): Format, beautify, validate and read JSON, and find the line that broke it.
- [HTML formatter](https://filetity.com/html-formatter): Beautify minified or messy HTML into something readable.
- [JSON diff](https://filetity.com/json-diff): Compare two JSON documents and see exactly what differs.
