The file is read locally by your browser using the File API. It never leaves your device — there is no upload step.
pdf.js renders each page to an HTML Canvas at your chosen resolution (default 150 DPI). Higher DPI = more detail, larger file.
A Web Worker runs MozJPEG (Mozilla's tuned JPEG encoder compiled to WebAssembly) to compress each page image. MozJPEG typically saves 20–30% more than the browser's built-in JPEG encoder at the same visual quality.
pdf-lib rebuilds the PDF by embedding the compressed JPEG pages. The output is a standard PDF you can open anywhere. Note: rasterising removes selectable text and annotations — the output is an image PDF.
PDF Crush compresses PDF files entirely in your browser using MozJPEG (compiled to WebAssembly) and pdf-lib. No server, no uploads, no account needed.
Built as part of a series of privacy-first browser tools by benrichardson.dev.
Stack: Vite · TypeScript · pdfjs-dist · @jsquash/jpeg · pdf-lib · Vitest