Compress a PDF's File Size
Shrink a large PDF without flattening your text to an image. Pages with real text keep that text selectable, only scanned pages and embedded photos get recompressed. Nothing is uploaded, it all happens on your device.
Compressing to email a PDF? Try the email-size preset.
Click to choose a PDF file, or drag and drop it here
Stays on your device, nothing is uploaded.
Resolution and quality only affect scanned pages and embedded photos, real text is never touched.
Are my PDF files uploaded anywhere?
No. Compression happens entirely inside your browser using JavaScript. Your files never leave your device or touch a server.
How does this actually shrink the file?
Pages that contain real text are left alone structurally, only the embedded photos on them get recompressed at the quality you pick. Pages that are actually just one big scanned image (no real text at all) are re-rendered as a compressed JPEG at the resolution you pick. Either way, the file is rebuilt around those smaller pieces.
Will my text still be selectable afterward?
Yes, on any page that has real text, that text is never touched, so it stays selectable and searchable. Only pages that were already just a flat scanned image get flattened again, since there's no real text on them to lose.
What if the result isn't smaller?
If nothing in the PDF can be safely shrunk without flattening real text or visibly hurting quality, the original file is kept exactly as it is, byte for byte, rather than handing back something bigger or worse.
Can I compress a password-protected PDF?
Not currently. Password-protected or encrypted PDFs can't be read by the tool and will show an error, remove the password first with a PDF reader.
How it works
Most online "PDF compressors" do one crude thing: render every page to a JPEG and stack the JPEGs back into a PDF. That shrinks the file, but it also silently destroys your selectable, searchable text. This tool deliberately doesn't work that way. Before touching anything, it uses pdf.js (Firefox's PDF engine) to check each page for real extractable text, and splits the document into two kinds of pages that get treated completely differently.
Pages with real text are never rasterized. Their text, fonts, and vector graphics stay byte-identical; the only thing touched is embedded photos. pdf-lib walks each page's internal resource dictionary to find image objects, and any plain baseline JPEG gets decoded, optionally downscaled, and re-encoded at your chosen quality. Images with transparency masks or unusual color spaces are deliberately skipped rather than risked, and a recompressed image is only swapped in if it actually came out smaller. Pages with no text at all, which is what a scanned page is, are safe to flatten: they're re-rendered at your chosen DPI and stored as one JPEG each, since there was never any text on them to lose.
A final pass matters more than it sounds: pdf-lib never deletes replaced objects on its own, so the tool runs a mark-and-sweep over the file's object graph and drops everything no longer referenced, the old full-size images included. Without that step the "compressed" file would quietly keep all its original data. And if the rebuilt file isn't smaller than the original, you get your original back, byte for byte. This is why results vary honestly: scans often shrink 70 to 90%, while a text-only PDF that's already efficient may not shrink at all.
All of this runs in your browser's memory. Open DevTools, watch the Network tab while compressing a contract or a bank statement: no request ever carries your file. The download is generated locally from a blob.
From the blog: Why PDF Compression Works Great on Scans and Barely on Reports