Most online file compressors still follow the same 2012 playbook: upload your PDF, contract, or slide deck to a remote server, process it in a queue, and gate usage behind daily limits or login walls. And for Microsoft Office files (.docx, .pptx, .xlsx), many web tools simply wrap an already-compressed OOXML file inside an outer .zip—saving ~1% while forcing recipients to unzip before editing.
With modern browser WebAssembly and Web Workers, you can run compiled C and Rust compression codecs directly on the user's CPU with 0 bytes of user files uploaded.
I built FileCompressor.dev and open-sourced the Web Worker engine, native OOXML Office module, deterministic 6-file benchmark harness (fc-bench-v2), and Playwright + LibreOffice CI verification suites under the MIT license:
- Live workbench: https://filecompressor.dev/
- Open-source engine & verification repo (MIT): https://github.com/guyuedumingx/filecompressor
- Release
v2.1.0& public green CI Run#46370568518(4/4 jobs): https://github.com/guyuedumingx/filecompressor/releases/tag/v2.1.0
1. Architecture: Dedicated Codecs per Format Inside a Web Worker
Instead of calling canvas.toBlob() (which leaves massive JPEG savings on the table and actually bloats most PNGs), every file routes to a specialized WebAssembly/JS pipeline inside an isolated Web Worker:
| Format | Client-Side Engine | Key Engineering Detail |
|---|---|---|
| JPEG / JPG | MozJPEG WASM (@jsquash/jpeg@1.6.0) | Multi-pass trellis quantization, progressive scans, HVS quant table |
| PNG | libimagequant + Rust OxiPNG WASM | Perceptual palette (Q15–97) or 100% pixel-lossless OxiPNG (Q98–100) |
| WebP | Google libwebp WASM (method: 6, Sharp YUV) | Consistent cross-browser output including Safari/WebKit |
| AVIF | libaom AV1 WASM | Lazy-loaded strictly on demand |
pdf-lib + MozJPEG XObject recompression + fflate | Deduplicates repeated logos, strips XMP/thumbnails, runs binary-search Target Size while keeping vector text selectable by default | |
| Word / PowerPoint / Excel | Native OOXML via fflate@0.8.2 + MozJPEG / OxiPNG | Optimizes word/media/, ppt/media/, and xl/media/ in place while copying XML, styles, animations, and formulas byte-for-byte untouched |
| ZIP & Plain Text | fflate DEFLATE Level 9 | Compresses media/PDF/Office natively before bundling up to 40 files into one local .zip |
Safety guards built into the worker
- No-bloat retention guard: Whenever format and dimensions stay unchanged and re-encoding fails to reduce byte size (e.g., an already-compressed JPEG or image-free spreadsheet), the worker returns the original file untouched instead of inflating it.
- OOXML integrity & security guards: Skips encrypted OLE2 files and digitally signed packages (
_xmlsignatures/) automatically, enforces a 250 MB decompressed RAM guard against ZIP bombs, and keeps exact internal media filenames/extensions so Office relationships never break.
2. Reproducible 6-File Benchmark (fc-bench-v2) & Matched-Quality Competitor Comparison (2026-11-30)
Headline "up to 90% smaller!" claims are meaningless without knowing visual fidelity, DPI, and whether PDF text remained selectable. On 2026-11-30, we downloaded our exact deterministic fc-bench-v2 corpus from /compression-benchmark, ran live public web benchmarks against Squoosh, TinyPNG, PDF24, and iLovePDF (no accounts, no CAPTCHA bypass), and measured full-frame RGB PSNR (dB) in Pillow plus embedded PDF resolution & selectable text with Poppler (pdfimages -list, pdftotext):
| Corpus File | Tool & Mode | Upload? | Output Size | Savings | Measured Fidelity / Integrity |
|---|---|---|---|---|---|
bench-photo-1600x1066.jpg (635.8 KB) | FileCompressor · MozJPEG Q76 | No (0 B) | 69.7 KB | −89.0% | 35.86 dB PSNR |
bench-photo-1600x1066.jpg (635.8 KB) | Squoosh · MozJPEG Q76 | No (0 B) | 76.2 KB | −88.0% | 35.96 dB PSNR |
bench-photo-1600x1066.jpg (635.8 KB) | FileCompressor · MozJPEG Q90 (TinyPNG PSNR match) | No (0 B) | 259.2 KB | −59.2% | 37.75 dB PSNR |
bench-photo-1600x1066.jpg (635.8 KB) | TinyPNG (auto web preset) | Yes (cloud) | 268.2 KB | −57.8% | 37.82 dB PSNR |
bench-photo-1600x1066.jpg (635.8 KB) | FileCompressor · libwebp Q76 (method 6) | No (0 B) | 52.1 KB | −91.8% | 35.73 dB PSNR |
bench-photo-1600x1066.jpg (635.8 KB) | Squoosh · WebP Q76 (effort 4) | No (0 B) | 87.2 KB | −86.3% | 36.02 dB PSNR |
bench-ui-1600x1066.png (159.1 KB) | FileCompressor · ImageQuant + OxiPNG Q76 | No (0 B) | 42.3 KB | −73.4% | 62.68 dB PSNR · Alpha intact |
bench-ui-1600x1066.png (159.1 KB) | Squoosh · OxiPNG + Palette (256 colors) | No (0 B) | 43.4 KB | −72.7% | 65.51 dB PSNR · Alpha intact |
bench-ui-1600x1066.png (159.1 KB) | TinyPNG (auto web preset) | Yes (cloud) | 37.0 KB | −76.7% | 57.13 dB PSNR · Alpha intact |
bench-ui-1600x1066.png (159.1 KB) | FileCompressor · OxiPNG Lossless (Q100) | No (0 B) | 87.5 KB | −45.0% | 100% pixel-lossless · Alpha intact |
bench-report-4pages.pdf (1.17 MB) | FileCompressor · PDF Balanced | No (0 B) | 174.7 KB | −85.4% | 211–218 PPI kept · Text selectable |
bench-report-4pages.pdf (1.17 MB) | PDF24 web (144 DPI / Q75) | Yes (cloud) | 187.6 KB | −84.3% | Downsampled to 144 PPI · Text selectable |
bench-report-4pages.pdf (1.17 MB) | iLovePDF web (Recommended) | Yes (cloud) | 123.1 KB | −89.7% | Downsampled to 150 PPI · Text selectable |
bench-report-4pages.pdf (1.17 MB) | FileCompressor · PDF Strong | No (0 B) | 105.0 KB | −91.2% | 150 PPI photos / 218 PPI UI · Text selectable |
Fair takeaways from the numbers
- On UI PNGs, TinyPNG's aggressive auto palette beats FileCompressor Q76 by ~5.4 KB (
37.0 KBvs.42.3 KB), trading off ~5.5 dB PSNR (57.13 dBvs.62.68 dB). - On JPEGs at matched ~37.8 dB PSNR (
Q90), FileCompressor lands 3.4% smaller than TinyPNG with 0 bytes uploaded. - On 4-page multi-image PDFs, inspecting embedded images with
pdfimages -listshowed why DPI matters: FileCompressor Balanced kept 211–218 PPI while still finishing smaller than PDF24 (144 PPI), and FileCompressor Strong matched iLovePDF's150 PPIphoto resolution while finishing 14.7% smaller (105.0 KBvs.123.1 KB)—all locally.
Full raw JSON logs: benchmarks/competitor-matched-quality-2026-11-30.json.
3. Verifying "Zero Uploads" & Real Office Opening in Public GitHub Actions CI
Instead of just saying "we don't upload your files" and "your Office docs won't break", we ship 4 automated CI jobs in GitHub Actions Run #46370568518 (v2.1.0):
- Zero-Upload Playwright Canary Audit (
scripts/verify-privacy.mjs, 6/6 PASS): Drops a canary PDF/PNG containing unique filename & payload tokens, hooks everyGET/POST/PUT/sendBeacon/WebSocket pluslocalStorage/sessionStorage/IndexedDB, verifies 0 leaks, and tests offline compression viacontext.setOffline(true).- Transparent boundary: Loading the web app still performs read-only CDN
GETrequests (lazy-loaded WASM codecs oncdn.jsdelivr.netand the Inter font) plus lightweight anonymous aggregate telemetry (PVUV with a 36-byte_pv_idkey inlocalStorage, GA4, Cloudflare RUM)—zero file bytes or filenames ever leave RAM. Full audited host table: https://filecompressor.dev/privacy-verification
- Transparent boundary: Loading the web app still performs read-only CDN
- Multi-Engine Compatibility (
scripts/verify-compatibility.mjs, 24/24 PASS): Runs end-to-end PDF (page count + selectable text viapdfjs-dist), JPEG, PNG alpha (alpha === 0corner assertion), WebP, Batch ZIP, and native.pptx/.docx/.xlsxchecks across Chromium 159, Firefox 159, WebKit 27.2 (ubuntu-latest), and real Microsoft Edge 158.0.4370.33 onwindows-latest. - Real Office Suite Opening Verification (
scripts/verify-office-open.mjs, 3/3 PASS): Builds spec-compliant ECMA-376.docx,.pptx, and.xlsxdocuments with embedded photos, tables, speaker notes, and=SUM(B2:B4)formulas, compresses them live onfilecompressor.dev, and opens/renders them in LibreOffice 26.2.7.3:- Word (
.docx):1.48 MB → 88.7 KB(−94.2%), Writer rendered 2 pages with paragraphs & tables intact. - PowerPoint (
.pptx):1.48 MB → 82.6 KB(−94.6%), Impress rendered all 3 slides with speaker notes intact. - Excel (
.xlsx):1.45 MB → 51.3 KB(−96.6%), Calc recalculated=SUM(B2:B4)→720cleanly.
- Word (
4. Honest Limitations
- No video or audio compression: Intentionally omitted so the workbench stays lightweight rather than downloading 30+ MB FFmpeg WASM binaries.
- Browser RAM caps: Up to 100 MB per PDF/Office file and 50 MB per image on desktop (recommend <= 40 MB PDFs and 5–15 files on phones).
- Physical mobile handsets: Automated desktop CI covers Chromium, Firefox, WebKit, and Windows Edge; physical iPhone Safari and Android Chrome handsets are still transparently marked Pending on
/browser-compatibility(where you can also run a 1-click self-test on your own device).
If you run into an edge-case PDF, Office deck, or want to reproduce the benchmarks on your own machine, clone guyuedumingx/filecompressor or drop feedback in the comments!