Zero Signup ToolsFree browser tools

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

0 B

Optimization options

Your XML is minified entirely on your device. Nothing is uploaded.

How to use

  1. Paste your XML into the input area on the left, or click Load sample to try the minifier with a multi-namespace RSS feed.
  2. Choose which extras to remove. Strip comments, Strip XML declaration, Strip processing instructions, and Strip DOCTYPE are independent toggles.
  3. Optionally turn on Collapse text whitespace to compact spaces inside element content, and Self-close empty tags to rewrite <name></name> as <name/>.
  4. 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.
  5. 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

All tools
All toolsDeveloper Tools