Upload a .docx file and we'll repack it with zopfli (a slower-but-tighter DEFLATE), strip Word's pretty-printing whitespace from internal XML, and optionally drop optional parts and recompress embedded images. Best ratios come from documents with oversized images.
curl -X POST -F "file=@input.docx" \ "https://htmlcompressor.galaxygate.net/compress-docx?mode=lossy" \ --output input-min.docx
Modes: safe | aggressive | lossy (default lossy). Pass output_format=json to get a JSON response with file_base64 and stats instead of the binary file.
*.xml / *.rels parts (preserving CDATA and xml:space="preserve" text)advzip --shrink-insane) instead of plain DEFLATE-9 — ~3-8% tighter at the cost of compression speedsafe does, plus:word/theme/*, word/fontTable.xml, word/settings.xml, word/webSettings.xml, word/styles.xml, customXml/*, docProps/*, word/glossary/*, comments-extension files. Word silently falls back to defaults.jpegtran -optimize -copy none -progressive) and PNGs (optipng -o5) losslesslyaggressive does, plus:[Content_Types].xml and the document rels patched accordinglyThe minimum-possible valid .docx is around 900 bytes (zip headers + 3 minified XML parts). Reductions over ~95% are only achievable on files that are dominated by oversized embedded images. Plain prose with no images can be compressed maybe ~50% in lossy mode and no further while remaining a valid Word document — the rest is Shannon entropy of the text itself.