PDF Compressor: Shrink File Size Without Uploading
Mail systems, application portals, and support desks reject oversized attachments, and a scanned contract or photo-heavy report can sit far above those limits even when the content itself is simple. This page rebuilds every page of the PDF as a compressed image inside your browser, then writes a new PDF from those pages. Choose one of three quality tiers, press Compress PDF, and read the summary line before you download. The document is parsed and rebuilt locally, so nothing is sent to a server.
Compress a PDF in Your Browser
Choose a PDF
Pick one file. Password-protected and damaged files are reported when you press Compress PDF.
Compression options
Smaller file draws pages at 1280 px wide, Balanced at 1600 px, Higher quality at 2048 px.
How It Works
pdf.js opens the file you picked and walks it page by page. Each page box is measured in points, then a canvas scale is computed as the tier width in pixels divided by the natural pixel width at 96 DPI, clamped between 1 and 3. The page is painted onto the canvas over a white background, and the canvas is encoded as a JPEG at the tier quality: 0.5 for Smaller file, 0.72 for Balanced, 0.85 for Higher quality.
pdf-lib then builds the output document. Every canvas becomes one new page whose box in points is the pixel size multiplied by 72/96, the JPEG bytes are embedded, and the picture is drawn to fill the page. The producer field is set to FlowStack Tools so the rebuilt file is identifiable in reader properties.
When the rebuild finishes, its byte count is compared against the original. If the new file is smaller by at least one percent, the download link appears with the savings in the summary line. If the rebuild came out the same size or larger, the line says the original was kept instead and nothing is offered for download, so a bad trade never replaces your file. All of this happens without a network request.
Before and After
contract-scan.pdf
40 pages, 12.4 MB
portal rejects anything over 10 MB 12.4 MB compressed to 1.8 MB (86% smaller)
download: compressed.pdf
40 pages rebuilt, one JPEG each notice.pdf
2 pages of plain text, 46 KB
already about as small as it gets 46 KB would grow to 118 KB; the original was kept instead
no download link offered
try the source file as it is Use Cases
| Developer | Production | Workflow |
|---|---|---|
| Getting a 30 MB spec under an upload cap | Shrinking a scanned packet before email | Filing a lighter copy in a case portal |
| Balanced tier, then read the summary | Smaller file for photo-heavy pages | Higher quality when fine print matters |
| Page count checked against the source | Original kept when the line says so | Compress each file, then merge the results |
| Output opens in any PDF reader | Producer field reads FlowStack Tools | Saved as compressed.pdf, ready to attach |
Common Mistakes
- Expecting a text PDF that is already small to drop by 90 percent. Rasterizing pages can cost more bytes than the original encoding saved, which is why the page keeps the original whenever the rebuild grows.
- Picking Smaller file for documents full of fine print. At 1280 px wide and quality 0.5, 8-point type turns soft; step up to Balanced or Higher quality and compare the summary line again.
- Forgetting what the rebuild removes. Selectable text, hyperlinks, bookmarks, and form fields do not survive the trip through the canvas, so a document that must stay searchable or clickable should keep its original.
- Trying a password-protected file. The decoder refuses locked files and the issues line explains why; remove the password in a desktop app first and come back with that copy.
Best Practices
- Start with the Balanced tier. Read the summary line, and only move to Smaller file or Higher quality when the number is not where you need it.
- Compare page counts before and after. The rebuild writes exactly one page per source page, so a mismatch means something went wrong and the file should not be sent.
- Open a dense page of the result and zoom in. If the smallest type is hard to read, run the source again at a higher tier rather than hoping the recipient's screen is kinder.
- Keep the original beside the compressed copy. The summary line is honest about growth, but the source file is still the only version with selectable text and live links.
Frequently Asked Questions
Will this shrink every PDF?
No. Photo-heavy and scanned files drop the most, often by half or more. A text PDF that already uses small embedded fonts and few images may barely change, and when the rebuild comes out larger the page keeps the original and says so in the summary line.
Should I compress a scanned or a text PDF?
Scans are the best candidates because each page is one large picture, and the rebuild replaces it with a smaller picture at a chosen width and quality. Text PDFs can still shrink when they carry big images, but the text itself is re-drawn as pixels either way.
Is quality lost when I compress?
Yes, in two ways. Each page becomes a JPEG image, so fine print can turn soft at the lower tiers, and the rebuilt file has no selectable text, links, form fields, or annotations. Open the result and read a dense page before you send it on.
What do the three tiers mean?
Smaller file draws each page at up to 1280 pixels wide with JPEG quality 0.5, Balanced uses 1600 pixels and 0.72, and Higher quality uses 2048 pixels and 0.85. Wider pages and higher quality both mean more bytes in the finished PDF.
Does the file leave my device?
No. pdf.js reads the bytes in the tab, the canvas encodes each page, and pdf-lib writes the new PDF in memory. The download link points at a local object URL that exists only in this browser session.
Will the result fit an email attachment limit?
It often will. Many mail systems and portals cap attachments at about 25 MB, and a 30 MB scanned report at the Balanced tier usually lands well under that. Read the summary line, since the exact drop depends on how photographic the pages are.
Can I merge files after compressing them?
Yes. The output is an ordinary PDF, so run each source through this page, then join the results with the PDF Merger. Compress first and merge second, because merging large originals first would only make the second pass slower.