# XML Formatter

> XML formatter and validator: pretty print with indentation, minify, and find unclosed or mismatched tags by line and column. Your XML stays in your browser.

Source: https://widgetpantry.com/en/xml-formatter · Türkçe: https://widgetpantry.com/tr/xml-duzenleyici

Indent XML that is crammed onto one line or messy, minify it, and find structural errors by line and column.

Runs in your browser: files and text are not uploaded. [Use the tool](https://widgetpantry.com/en/xml-formatter)

## How to use it

1. Paste your XML into the left box.
2. Choose the indentation and press “Format” or “Minify”.
3. Take the result with “Copy”; if there is an error, its line and column are shown.

## What it checks

The tool checks that the XML is well formed: every tag that opens closes with the same name, tags nest in the right order, and the document has a single root element. If something is wrong, the line and column of the first error are shown.

Formatting keeps attributes, quotes, comments, CDATA sections and escapes such as &amp; exactly as written; only the whitespace between tags changes. Definitions inside a DOCTYPE are never resolved and no outside file is fetched.

There is no schema (XSD or DTD) validation, so a well-formed document may still not match a particular schema.

## Frequently asked questions

### Does it validate against a schema (XSD)?

No. It checks well-formedness only: tags opening and closing correctly and a single root element. Use an IDE or a tool such as xmllint for schema validation.

### Does formatting change my text?

Whitespace and line breaks between tags change, and in elements that hold only text the leading and trailing spaces are trimmed. Where whitespace matters, “Minify” keeps text exactly as it is.

### Does it handle large files?

A few megabytes of XML format comfortably in the browser. Very large files may slow it down.

### Is my XML sent anywhere?

No. It is processed in your browser; the XML you paste is never sent to our server or stored.

## Related tools

- [JSON Formatter](https://widgetpantry.com/en/json-formatter): Online JSON formatter and validator: pretty-print, validate and minify JSON. Line and column for errors, 2/4-space or tab indentation, one-click copy.
- [Base64 Encode/Decode](https://widgetpantry.com/en/base64-encode-decode): Base64 encode and decode online: turn text into Base64 or Base64 back into text. UTF-8, emoji and base64url support. Runs in your browser.
- [URL Encoder/Decoder](https://widgetpantry.com/en/url-encode-decode): URL-encode text or decode codes like %C3%A7: a single part or a full address, with an option for + as space. Runs in your browser; nothing is sent.
