Compress PDF
Shrink a PDF by re-encoding the images inside it, with a quality setting you control and honest before/after numbers. The work happens in your browser, so the document is never uploaded.
Runs entirely in your browser — nothing is uploaded
Drop a PDF here to compress it
Works best on scans and image-heavy documents. Nothing is uploaded.
How to use it
- Drop a PDF onto the box above, or click Choose a file.
- Set the image quality — 60 per cent is a good default for scans and photos.
- Optionally cap the maximum image size. For anything that will be read on screen, 1600 px is plenty and usually saves more than quality alone.
- Click Compress PDF. The before and after sizes appear immediately, with a count of how many images were re-encoded and why any were skipped.
- Download the result — and check a page or two before deleting your original.
How it works
The size of a large PDF is almost never its text. A 40-page report of prose might be 200 KB; a single scanned page can be 3 MB. The difference is bitmap images, and that is the only thing worth attacking.
So compression here means going after the images specifically. The document’s object graph is walked to find every image XObject — the objects a PDF uses to store bitmap data. Each one is decoded, redrawn onto a canvas at the size you asked for, re-encoded as JPEG at your chosen quality, and written back into the document at the same object reference. Everything else in the file is left completely alone.
Two decoding paths cover the images that matter. An image stored with DCTDecode is
already a JPEG file, so its bytes go straight to the browser’s own JPEG decoder — which is
also why CMYK and progressive JPEGs come out correctly rather than needing special handling.
An image stored with FlateDecode holds raw pixel samples, which are expanded to RGBA and
turned into a bitmap. Only the layouts that can be reconstructed without guessing are
accepted: 8-bit DeviceRGB and DeviceGray, with no remapping array.
The work is deliberately cautious. An image is only replaced when it decoded cleanly and the re-encoded version is genuinely smaller — if JPEG comes out bigger, the original stream stays. Transparency masks are skipped entirely, because lossy artefacts on a mask show up as halos around whatever it is masking. Anything under 4 KB or smaller than 100 × 100 pixels is skipped as not worth the risk. Every skip is counted with its reason, which is what makes it possible to say “your PDF did not shrink, and here is exactly why” instead of reporting a meaningless zero.
Tips
- Try capping the image size before reaching for low quality. 1600 px at 70 per cent generally looks better and lands smaller than native resolution at 35 per cent.
- Compress once. Running a file through twice compounds the artefacts for very little further gain.
- If a document needs to be both small and legible, compress it and then open the result in the PDF Viewer at 200 per cent zoom. Judging quality from a thumbnail is how people end up sending unreadable scans.
- Merging first with Merge PDF and compressing second gives a better result than compressing each part and then merging.
Frequently asked questions
Is my PDF uploaded to a server?
Why did my PDF barely shrink, or not shrink at all?
How does it decide there is nothing to compress?
How much smaller will my file get?
Will the text in my scanned PDF still be readable?
Should I lower the quality or cap the image size?
Does it change anything other than the images?
Is the compression lossy? Can I undo it?
Why is my password-protected PDF rejected?
Related tools
Image Compressor
Cut image file size with a quality slider and a side-by-side before/after preview.
Merge PDF
Combine several PDFs into one file and drag the pages into the order you want before merging.
Split PDF
Pull out a page range or split every page of a PDF into its own separate file.
PDF to Image
Export each page of a PDF as a JPG or PNG image file.
Browse every tool in PDF Tools.
Found a bug or want a feature? Tell us — ToolStash is built from user requests.