Config & Markup Tool

XML Formatter & Minifier Free Online

Beautify messy XML with proper indentation, minify it for production, and validate for syntax errors. Supports custom indent size and inline attribute options. Runs entirely in your browser.

Runs in browser Data never uploaded Syntax validation Format & minify
Indent:

XML Input

Output

Pro — XML to JSON, XPath query, XML schema validation, API access

API access · Priority queue · Team workspace

Upgrade — $19/mo

How It Works

STEP 1

Paste Your XML

Paste any XML — a config file, API response, SOAP envelope, Maven POM, or SVG — into the input panel. Click Sample to load an example with nested elements, attributes, and comments.

STEP 2

Choose Mode & Options

Select Format for pretty-printed output with your chosen indent size (2 spaces, 4 spaces, or tabs), or Minify to strip all whitespace and comments for the smallest possible output.

STEP 3

Copy or Download

Click Copy to put the result on your clipboard, or Download to save it as an .xml file. A green badge confirms valid XML; a red badge with an error message flags any syntax problems.

XML Formatter Features

Format, minify, validate, and download XML with configurable options

Pretty-Print

Reformats minified or single-line XML with clean indentation. Choose 2-space, 4-space, or tab indentation. Every level of nesting is visually clear for easy reading and debugging.

Minify

Strips all whitespace, newlines, and optionally comments to produce the smallest possible XML string — ideal for APIs, embedded payloads, and config storage where size matters.

Syntax Validation

Uses the browser's built-in DOMParser to validate XML. Unclosed tags, missing quotes, illegal characters, and encoding issues are all caught and reported with a clear error message.

Comment Removal

Optionally strip all XML comments () from the output. Useful for cleaning up verbose config files or removing TODO notes before sharing output publicly.

Download as File

Save the formatted or minified XML directly as an .xml file with a single click — no need to paste into a text editor and save manually.

100% Offline

All formatting and parsing runs in your browser using the native DOMParser API. No XML data is ever sent to a server — safe for SOAP messages, config files, and API responses.

Free vs Pro

FeatureFreePro
Format & pretty-print
Minify XML
Syntax validation
XML to JSON conversion
XPath query runner
REST API access

Frequently Asked Questions

Any well-formed XML: configuration files, SOAP envelopes, RSS/Atom feeds, Maven POM files, Android manifests, SVG images, XHTML, and API responses. The formatter uses the browser's native DOMParser which supports any valid XML 1.0 document.

The tool uses the browser's built-in DOMParser (the same engine used to parse web pages) to try parsing your XML. If the result contains a parseerror element, the error message from the parser is displayed. This catches unclosed tags, illegal characters, and structural errors.

You can choose 2 spaces, 4 spaces, or tabs. Most XML editors default to 2 or 4 spaces. Tabs are preferred in some style guides and result in slightly smaller files since one character represents one indent level.

No. Minification only removes insignificant whitespace (whitespace between tags) and optionally comments. It preserves all text content, attribute values, and the structure of the document. The result is semantically identical to the original.

XML is a strict, general-purpose markup language — every tag must be closed, attribute values must be quoted, and case is significant. HTML is more lenient. XHTML is the intersection: HTML written to XML rules. This tool handles XML and XHTML but not lenient HTML.

No. All formatting, minification, and validation runs in your browser using the native DOMParser API. Nothing is transmitted to any server, making it safe for SOAP messages, PII data, config files, and API responses.