Developer Tools
XML Minifier
Minify XML in your browser. Strip comments, drop the prolog, collapse whitespace, and self-close empty tags. See bytes saved live, no upload.
XML minifier
Optimization options
Your XML is minified entirely on your device. Nothing is uploaded.
How to use
- Paste your XML into the input area on the left, or click Load sample to try the minifier with a multi-namespace RSS feed.
- Choose which extras to remove. Strip comments, Strip XML declaration, Strip processing instructions, and Strip DOCTYPE are independent toggles.
- Optionally turn on Collapse text whitespace to compact spaces inside element content, and Self-close empty tags to rewrite <name></name> as <name/>.
- Read the minified output on the right with byte savings updating live, then click Copy XML to grab the result or Replace with minified to load it back into the editor.
- If the parser reports an error such as Unterminated CDATA section, fix the spot it points to in the input and the output updates instantly.
About this tool
XML Minifier compacts an XML document into the smallest equivalent form your browser can produce. Paste any RSS feed, sitemap, SOAP envelope, Maven pom.xml, Android manifest, SVG, or generic XML payload, and the minified result appears on the right as you type. The tool is built around a small XML tokenizer plus a careful printer, so it handles the syntax that real documents use: the <?xml version="1.0" ?> declaration at the top of the file, <?xml-stylesheet ?> and other processing instructions, <!DOCTYPE ...> declarations (including the [ ... ] internal subset that DTDs use), <!-- multi-line comments -->, <![CDATA[ ... ]]> sections that wrap raw HTML or script, and quoted attribute values that may contain spaces, > characters, or other markup-looking text. Character data, CDATA sections, comments that survive the strip option, processing instructions, and attribute values are passed through verbatim, never reformatted, so feed item descriptions, embedded scripts, namespace URIs, and signed payloads survive the minification intact. Six independent options let you tune the output: strip comments, strip the XML declaration prolog (some receivers do not allow one), strip processing instructions, strip the DOCTYPE, collapse runs of whitespace inside element text content into a single space (off by default since that can change rendered output), and self-close <name></name> empty element pairs as <name/> to save bytes. The byte counter at the top of the output measures the actual UTF-8 byte size with TextEncoder, not character length, so multi-byte characters in element names, attribute values, and CDATA content are counted correctly. Useful for shrinking sitemaps before submitting them to search engines, compacting RSS feeds before caching them in a CDN, normalizing SOAP envelopes before signing them, packing AndroidManifest.xml into a release build, and any place where every byte counts; for stripping the comment noise out of a config file before sharing it in a code review; and for turning a wall of indented test fixture XML into a single line that fits into a tooltip. Tokenizing and printing both run on your device, so the XML you paste here, including any production schemas, internal endpoints, signed payloads, and business logic embedded in element content, never leaves your browser.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
XML Formatter
Format, minify, and validate XML with line and column error reporting.
Open tool
DeveloperJSON Minifier
Compact JSON with live byte savings and a JS literal copy.
Open tool
DeveloperHTML Minifier
Compress HTML safely: collapse whitespace, strip comments, drop attribute quotes, shrink boolean attributes.
Open tool
DeveloperCSS Minifier
Compress CSS with comment, whitespace, hex, and zero-unit optimizations and a live byte-savings readout.
Open tool
DeveloperSQL Minifier
Compact SQL with live byte savings, comment stripping, and one-line output.
Open tool