# XML Formatter / Minifier

> Format XML with 2 or 4 space indentation, minify it, and check that it is well-formed. Copy the result. Runs in your browser, nothing is uploaded.

- Page: https://mondaytool.com/tools/xml-formatter
- Category: developer-tools
- Price: free, no sign-up. Most tools run in the browser, so input is not uploaded.
- Use it: open https://mondaytool.com/tools/xml-formatter. It is an interactive web page; this file is its documentation.

Last updated: 16 October 2026

## Beautify, minify and check XML

This **XML formatter** turns compact or messy XML into an indented, readable layout, or strips it down to a minified version. Before it does either, it checks that your XML is well-formed. Processing happens in your browser.

## How to use it

1. Paste your XML into **XML Input**. A sample is loaded to start with.
2. Choose **Beautify** or **Minify**.
3. For Beautify, set the **Indent** to 2 or 4 spaces.
4. Click **Beautify XML** or **Minify XML**.
5. Read the result in Output, then click **Copy**.

## How it works

The tool first runs your text through the browser's own XML parser. If it finds an error, such as a missing closing tag or two root elements, it shows the message and produces no output. If the XML is well-formed, you see a green confirmation and the result.

## What each mode does

| Mode | Result |
| --- | --- |
| Beautify | One tag per line, indented by nesting level. Elements that contain only text stay on one line. |
| Minify | Removes comments and the whitespace between tags. Text and CDATA sections are kept unchanged. |

The output panel also shows the number of lines and tags.

## Assumptions and limits

- The check is for well-formedness only. It does not validate against an XSD or DTD.
- Error messages come from your browser, so their wording can differ between browsers.
- Beautify leaves the text inside elements as it is, apart from trimming the ends.
- Minify deletes comments.

## Frequently asked questions

### Does it check my XML against a schema?

No. It only checks that the XML is well-formed: tags match, attributes are quoted and there is one root element.

### Why do I get no output?

The input has an error. Fix the problem shown in the red box and run it again.

### Is my XML sent to a server?

No. Parsing and formatting both run in your browser.
