What compressing a PDF actually means
A PDF can hold two very different things. It can hold instructions — draw this letter, in this font, at this position — which is how a document exported from a word processor works, and it is extraordinarily compact. Or it can hold photographs of pages, which is what a scanner produces, and that is where the weight comes from. Knowing which one you have decides whether compression will help or hurt.
Why this makes some files bigger
Compression in a browser means rasterising: rendering each page and storing the result as a JPEG. For a scan that is a straight win, because you are replacing a big image with a smaller image. For a text document it is a disaster in both directions — a page of text might occupy a couple of kilobytes as instructions and two hundred as a photograph. The tool measures the result and tells you when that happened, instead of handing you an inflated file labelled "compressed".
What you give up
Everything that depends on the text existing as text. You cannot select or copy a sentence, search inside the document, or have a screen reader announce it. An automated system that reads invoices will no longer find the fields. If any of that matters for the file you are about to send, compression is the wrong operation and a lighter scan or a different export is the right one.
Choosing the settings
Resolution decides the size far more than quality does, because it changes the pixel count on both axes at once. 110 DPI is comfortable on screen and is the sensible default; 72 DPI is for documents that will only ever be looked at on a phone; 150 and above is for something that may be printed. Quality around 70% is where JPEG stops wasting bytes without visible damage on a scan.
Why it runs in your browser
Documents that are too heavy to send are rarely trivial ones — they are contracts, medical records, scanned identity papers, a dossier someone put together. Uploading those to a compression service is handing over a full copy. Here the rendering is done by PDF.js and the rebuilding by pdf-lib, both running on this page.
How to tell what kind of PDF you have
Open it and try to select a line of text with the mouse. If the selection highlights words, the document is vector text and compressing it here will almost certainly make it bigger — the useful move is to re-export it from whatever produced it, at a lower image quality. If the cursor just draws a rectangle over the page, it is a scan: every page is already a photograph, there is nothing to lose, and the saving is usually dramatic. A 1 MB scan commonly drops below 200 KB at 110 DPI without becoming hard to read.
Want to go deeper? Read our guide: How to make a PDF smaller for email and upload forms