PDF Compressor
Shrink a PDF and keep its text selectable: only the photos inside are recompressed, and the file never leaves your device. Scans can be rasterised instead. Real before/after sizes.
Photos are downsampled to this many pixels per inch at the size they are printed on the page.
Result
Drop or choose a PDF in the drop zone and its compressed size shows up here — the exact before → after bytes, how much you saved, and a live download.
Your PDF is processed entirely in your browser and never uploaded. Rendering and rebuilding happen in memory on your own device — no server call for the compression. Disconnect from the internet and it still works.
Offline later: once you have opened this page with a connection, it reopens with none — your browser keeps a copy. Compressing offline also needs the PDF reader, which downloads the first time you open a PDF here, so compress one file online first. Not saved: the very first Polyatic page you ever open (open it again while online), and any page or link you have never opened.
Shrink a PDF without losing selectable text
Most oversized PDFs are not big because of their words. A 20-page report set in two fonts is typically 200–600 KB of text, fonts and drawing; drop in eight photos straight from a phone camera and it becomes 25 MB, because each 12-megapixel photo is stored at full resolution even though it is printed four inches wide. Keep text mode attacks exactly that weight and nothing else, in your browser, with nothing uploaded. It opens the original file with pdf-lib, finds every embedded image, works out the largest size each one is actually drawn at on any page, and re-saves it as a JPEG at the resolution and quality you pick. The new image is written into the same object the pages already point to, so the page content, fonts, annotations and links are carried over untouched and the text stays selectable, searchable and readable by screen readers.
Worked example: a report with phone photos
A 4032×3024 photo (12 MP) placed 5 inches wide only needs 750×563 pixels at 150 dpi — 1/29 of the pixels it carries. Re-encoded at quality 0.70, a photo that was 3–4 MB inside the PDF usually comes out under 150 KB. That is why a photo-heavy document can lose 80–95% of its size while every word stays real text. The result panel prints the real byte sizes before and after, plus a line such as “6 images recompressed, 1 left as is (1 with a transparency mask)”, so you can see what changed and what did not.
What Keep text will and will not touch
- Recompressed: JPEG (DCT) images in RGB or grey, and 8-bit Flate (zip-compressed) RGB or grey images, the kind a PNG screenshot becomes. JPEGs are decoded by the browser itself; Flate images are inflated with the browser’s built-in
DecompressionStream. - Left exactly as they are, and counted: images with a transparency mask (a JPEG has no alpha channel, so flattening one would paint a box over the page), Indexed-colour and CMYK images (re-encoding them would shift the colours), 16-bit images, and formats the browser cannot decode: JPEG 2000, CCITT fax and JBIG2, which are common in scans made by office copiers.
- Never rewritten: page content streams, fonts, annotations, form fields and links.
- Only swapped when smaller: an image whose new JPEG would not be smaller keeps its original bytes. If no image got smaller, the page tells you there was nothing to shrink and offers your original file — never a bigger one.
Rasterise mode, for scans
A scanned document has no text to keep: each page is already one big picture. Rasterise renders every page with Mozilla’s PDF.js at the dpi you choose, encodes it as a JPEG, and stitches the pages into a fresh PDF at their original size. Say a 10-page contract scanned at 300 dpi is 4.0 MB. At 150 dpi / quality 0.70 the pixel count falls to a quarter and JPEG drops detail the eye barely notices, so it typically lands at 0.9–1.4 MB, a 65–78% cut that still reads cleanly on screen. The cost is real: any text a PDF had becomes part of a picture, so it can no longer be selected, searched or read aloud. The page picks Keep text for you when PDF.js finds a text layer in the first pages, and Rasterise when it finds none.
| Keep text | Rasterise | |
|---|---|---|
| Best for | Reports, CVs, decks with photos | Scans, photographed pages |
| Text stays selectable | Yes | No — pages become images |
| Links and annotations | Kept | Lost |
| Text-only PDF | Nothing to shrink; original offered | Usually grows |
| Scan made of JPEG pages | Shrinks the page images | Shrinks the page images |
Choosing quality and resolution
Both dials re-run instantly. JPEG quality (0.30–0.95) trades sharpness for size; 0.60–0.75 is a good balance for reading. Resolution is pixels per inch at printed size: 72 dpi is smallest and fine for quick on-screen reading, 150 dpi (the default) reads cleanly on most screens, 200 dpi keeps fine detail. Your choices are kept in the address bar (for example ?mode=keep&q=0.70&dpi=150), so a link opens the tool with the same settings.
Honest limits and privacy
This is not Ghostscript or Acrobat. It does not subset fonts, remove unused objects or merge duplicate images, and a text-only PDF will not get smaller here. An image placed only inside an unusual structure it cannot follow is capped at an A4 page’s long side at your chosen dpi instead of its printed size. Very large images (over about 60 megapixels) are left alone so the tab does not run out of memory, and a PDF with hundreds of photos takes a while on a phone. What you gain is privacy: the file is read with the browser’s local FileReader, processed in memory and handed back as a download. Both libraries are pinned and served from this page, nothing is fetched for the compression, and the page’s only network call is one anonymous, self-hosted page-view count.
Questions
How do I shrink a PDF without losing selectable text?
Use the Keep text mode, which this page picks by itself when the PDF has a text layer. It opens the original document and recompresses only the embedded photos: each JPEG or 8-bit Flate image is downsampled to the chosen dpi at the size it is printed on the page and re-saved as a JPEG at the chosen quality. Text, fonts, page drawing, annotations and links are not rewritten, so the text stays selectable, searchable and readable by screen readers. A 6 MB report whose bulk is a few full-resolution camera photos typically lands well under 1 MB.
Is my PDF uploaded to a server?
No. The whole compression runs in your browser using JavaScript that is served from this page. Your file is read with the local FileReader API, processed in memory, and offered back to you as a download. There is no upload, no server round-trip, and the page keeps working with your network disconnected.
Which images does Keep text leave alone?
Images with a transparency mask (SMask or Mask), Indexed or CMYK colour, 16-bit samples, a TIFF predictor, or a format the browser cannot decode (JPEG 2000, CCITT fax, JBIG2) are left byte-for-byte as they are. An image is also kept when its re-encoded JPEG would not be smaller. The result panel counts how many images were recompressed and how many were left, with the reason for each group.
Why did nothing shrink?
Because a file's size can only come down if something in it is heavier than it needs to be. A born-digital text PDF stores letters as vector glyphs and is already compact, so Keep text finds no photos to recompress and says so, offering your original file rather than a re-saved copy that might be larger. Lowering the quality or dpi can help a PDF whose photos were already modestly compressed.
When should I use Rasterise instead?
For scans. A scanned document is a stack of page images with no real text, so rendering each page at 100–150 dpi and saving it as a JPEG cuts it hard: a 4 MB, 10-page office scan at 300 dpi commonly drops to about 0.9–1.4 MB at 150 dpi / quality 0.70. Rasterising flattens every page to an image, so any real text stops being selectable and searchable; that is why it is not the default for PDFs with a text layer.
Is this lossy or lossless compression?
Lossy for images in both modes: recompressed photos and rasterised pages are not pixel-identical to the original. In Keep text mode everything that is not a recompressed image (text, vector drawings, fonts, links) is carried over unchanged. Lossless tricks such as font subsetting and stream repacking are not done here; they typically save 5–20%. Keep your original if you need an exact copy.
What do the quality and resolution controls do?
Quality is the JPEG quality factor from 0.30 to 0.95: lower means a smaller file with more visible compression blocking. Resolution means two things depending on the mode. In Keep text it is the pixels per inch each photo keeps at the size it is printed (a photo shown 4 inches wide at 150 dpi keeps 600 pixels across). In Rasterise it is the resolution each whole page is rendered at. Both re-run the compression live and are saved in the page address, for example ?mode=keep&q=0.70&dpi=150.