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.

Drop a .docx file hereor click to choose — up to 50 MB
Selected:
Compression mode:
Mode:
Original: 0 bytes
Compressed: 0 bytes
Saved: 0 bytes (0%)
XML whitespace removed: 0 bytes
Image bytes saved: 0 bytes
Parts dropped: 0

Using the API

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.

What each mode does

safe (lossless)

  • Strips XML comments and Word's pretty-printing whitespace from *.xml / *.rels parts (preserving CDATA and xml:space="preserve" text)
  • Repacks the zip with zopfli (advzip --shrink-insane) instead of plain DEFLATE-9 — ~3-8% tighter at the cost of compression speed
  • Document is byte-equivalent when Word opens it

aggressive (lossless, drops optional parts)

  • Everything safe does, plus:
  • Drops 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.
  • Recompresses embedded JPEGs (jpegtran -optimize -copy none -progressive) and PNGs (optipng -o5) losslessly

lossy (default, aggressive + image downsampling)

  • Everything aggressive does, plus:
  • Embedded images resized to max 1024 px wide, re-encoded as mozjpeg quality 60
  • Photographic PNGs (no alpha) are converted to JPEG, with [Content_Types].xml and the document rels patched accordingly
  • The document still opens in Word; visible images just look smaller

What it can't do

The 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.