Cette page n’est pas encore traduite en français : elle s’affiche en anglais.

XML Minifier — Minify XML Online

Compact XML documents, feeds, sitemaps and SOAP payloads by removing indentation and comments — with a well-formedness check so nothing breaks.

Mis à jour le
Open file

Vos données ne quittent jamais votre ordinateur. Tout le traitement se fait localement dans votre navigateur.

Comment utiliser : XML Minifier

  1. Paste XML or open an .xml, .rss or .svg file.
  2. The document is checked for well-formedness; errors show the line.
  3. Choose whether to remove comments and trim whitespace around text values.
  4. Copy or download the minified XML.

What does XML minification do?

XML is often pretty-printed with indentation and line breaks to make it readable. For machines those characters are just extra bytes. An XML minifier removes whitespace between tags, normalizes spacing inside tags and optionally strips comments, while leaving element text, attribute values, CDATA sections and processing instructions exactly as they were.

What is preserved

PartHandling
<?xml … ?> declarationKept
<!DOCTYPE> and internal subsetsKept
<![CDATA[ … ]]>Kept byte for byte
Text inside elementsKept (optionally trimmed)
Whitespace-only text between tagsRemoved
CommentsRemoved (optional)

A note on mixed content

In document-style XML such as XHTML or DocBook, whitespace between inline elements can be meaningful (<b>bold</b> <i>text</i>). Whitespace-only nodes are removed by design, so check such documents before using the result, or keep them formatted. Data-oriented XML — feeds, configs, API payloads, sitemaps — is always safe.

Typical uses

  • Shrinking SOAP and XML API requests and responses.
  • Compacting RSS/Atom feeds and product feeds for merchant platforms.
  • Reducing the size of XML sitemaps and configuration files stored in databases.

To go the other way, use the XML formatter. SVG files are XML too, but the SVG optimizer saves much more by also simplifying paths and removing editor metadata.

Aussi recherché comme : minify xml, xml compressor, compress xml, xml one line, remove whitespace xml, xml minify online.

Outils complémentaires : XML Minifier

  • JSON Minifier — Remove all unnecessary whitespace from JSON, validate it at the same time and see exactly how many bytes you save — before and after gzip.
  • HTML Minifier — Shrink HTML pages and templates by removing comments and redundant whitespace, minifying inline <style> and <script>, and cleaning up attributes — while keeping the layout identical.
  • Sitemap Validator — Find and validate your XML sitemap — URL count, sitemap index children, lastmod coverage, duplicates and foreign-host URLs — and check that the pages it lists really return 200.
  • Gzip Compress & Decompress — Compress text or any file with gzip, zlib or raw deflate — or paste Base64 / open a .gz file to decompress it.

Questions fréquentes

Does minified XML still validate?
Yes. Only insignificant whitespace and (optionally) comments are removed, so a well-formed document stays well-formed and validates against the same schema.
Are CDATA sections changed?
No. CDATA content is copied exactly, including whitespace and special characters.
Why do I get a “not well-formed” error?
The XML has a structural problem such as an unclosed tag, an unescaped & or two root elements. The line number points to where the parser stopped.
Is my XML uploaded?
No. Everything runs in your browser.
Puis-je installer XML Minifier en tant qu’application web et l’utiliser hors ligne ?
Oui. XML Minifier est une application web installable (PWA) : elle s’installe depuis votre navigateur, sans passer par une boutique d’applications. Cliquez sur « Installer l’application » en haut de cette page dans Chrome ou Edge (Windows, macOS, Linux, ChromeOS) ; sur Android, utilisez « Partager » → « Ajouter à l’écran d’accueil » sur iPhone et iPad ; ou « Fichier » → « Ajouter au Dock » dans Safari 17+ sur Mac. L’application s’ouvre alors dans sa propre fenêtre avec sa propre icône, et comme elle s’exécute entièrement dans votre navigateur, elle continue de fonctionner hors ligne. Firefox sur ordinateur de bureau ne permet pas d’installer d’applications web. Comment fonctionne l’installation.

Outils similaires