Back to Blog
PDF Tools

How to Compress a PDF Without Losing Quality

PDF-Builder Team·

How to compress a PDF without losing quality

You need to email a PDF, but it's 35 MB and Gmail caps attachments at 25 MB. You search for "compress PDF" and find dozens of tools promising to shrink your file "without losing quality."

Is that actually possible? Sometimes yes, sometimes no. It depends on what's in your PDF and what you mean by "quality."

Here's what compression actually does to your document, when quality loss is unavoidable, and how to get the best results for your situation.


What makes PDFs large

PDFs grow large for three reasons: images, fonts, and accumulated data.

Images are the main culprit. A single high-resolution photo can add several megabytes. Scanned documents are essentially full-page images, which is why a 10-page scanned contract can easily exceed 50 MB while a 100-page text document might be under 1 MB.

Fonts add weight when embedded. If your document uses five different fonts, each one gets bundled into the file. A single font family can add 100-500 KB.

Accumulated data includes edit history, metadata, thumbnails, and objects from deleted content. PDFs edited multiple times often carry invisible baggage.

Text itself takes minimal space. A PDF with pure text and no images compresses poorly because there's little to remove.


Lossless vs lossy compression

PDF compression falls into two categories.

Lossless compression removes unnecessary data without affecting visible content. It strips metadata, flattens layers, removes duplicate objects, and applies algorithms like ZIP compression to text and vector graphics. The output looks identical to the original.

Lossless compression typically achieves 25-50% size reduction. If your PDF is already optimized or contains mostly images, expect less.

Lossy compression reduces file size by degrading images. It lowers image resolution, increases JPEG compression, or converts color images to grayscale. The output is smaller but visibly different from the original.

Lossy compression can achieve 80-95% reduction. A 42 MB PDF might shrink to 5 MB. The tradeoff is blurrier images and less detail when zoomed in.

Most "compress PDF" tools use lossy compression by default because it produces dramatic results. When they advertise "no quality loss," they mean "no noticeable quality loss at normal viewing size."


When quality loss is unavoidable

If your PDF contains high-resolution photos or scanned pages, significant compression requires quality loss. There's no way around this.

Lossless compression can't reduce a 5 MB photo to 500 KB. The image data is the data. To make it smaller, you have to remove information, which means reducing resolution or increasing JPEG artifacts.

However, "quality loss" isn't always visible. A photo at 300 DPI looks identical to one at 150 DPI when viewed on screen. The difference only appears when printing or zooming in. If your PDF will be read on a computer and never printed, reducing resolution has no practical impact.


When lossless compression works well

Lossless compression works well on:

  • Text documents with few images - Stripping metadata and optimizing fonts can reduce size 20-40%
  • PDFs edited multiple times - Clearing edit history and duplicate objects recovers space
  • Documents with embedded thumbnails - Some PDF creators embed page previews unnecessarily
  • Files with uncompressed images - Some PDFs contain images in raw formats that can be losslessly recompressed

If your PDF is mostly text, lossless compression might get you from 15 MB to 10 MB. It won't get you from 50 MB to 5 MB.


DPI and resolution explained

DPI (dots per inch) determines how detailed an image appears when printed. Higher DPI means more detail but larger file size.

  • 72-100 DPI - Screen viewing only. Text remains readable. Photos look fine at normal zoom.
  • 150 DPI - Standard for documents shared digitally. Good balance of size and quality.
  • 300 DPI - Print standard. Required for professional printing. Overkill for screen viewing.

Halving the resolution roughly halves the file size. A document with 300 DPI images can often be reduced to 150 DPI with no visible difference on screen.

The question isn't "what DPI is best" but "how will this document be used?" If it's going in an email to be read on screen, 150 DPI is fine. If it's going to a print shop, keep 300 DPI.


How to compress a PDF

Online tools

Online tools are the fastest option. Upload your file, click compress, download the result.

Smallpdf, iLovePDF, and Adobe Acrobat online all offer free compression. Most let you choose between compression levels (low, medium, high) which correspond to different amounts of image quality reduction.

The tradeoff: your file gets uploaded to their servers. For sensitive documents, this is a privacy concern. For a restaurant menu or public flyer, it doesn't matter. See our guide on PDF tool privacy for more on when this matters.

Desktop applications

Desktop applications compress files locally without uploading them anywhere.

PDF24 Creator (Windows) is free and includes compression with adjustable quality settings. You can preview the output before saving.

PDFgear (Windows, Mac, iOS) handles compression along with other PDF tasks. It processes files locally.

Adobe Acrobat Pro has the most control. The PDF Optimizer lets you set specific DPI targets for color, grayscale, and monochrome images separately. You can also remove specific elements like annotations, form fields, or embedded thumbnails.

For a full comparison of tools, see our best free PDF tools guide.

Command line

Ghostscript is a free command-line tool that compresses PDFs. It's useful for batch processing or automation.

The basic command:

gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

The -dPDFSETTINGS flag controls compression level:

  • /screen - 72 DPI, smallest size, lowest quality
  • /ebook - 150 DPI, good balance for digital documents
  • /printer - 300 DPI, high quality for printing
  • /prepress - 300 DPI, preserves color accuracy for commercial printing

Browser-based local tools

Some tools run entirely in your browser without uploading files. PDF-Builder processes PDFs using JavaScript and WebAssembly, keeping files on your device. This combines the convenience of online tools with the privacy of desktop software.


Compression benchmarks

Real compression results depend on what's in your PDF. Here are typical outcomes:

Text-heavy business report (original: 5 MB)

  • Lossless: 3 MB (40% reduction)
  • Lossy (medium): 1.2 MB (76% reduction)

Scanned contract, 10 pages (original: 45 MB)

  • Lossless: 42 MB (7% reduction)
  • Lossy (medium): 8 MB (82% reduction)

Photo-heavy product catalog (original: 28 MB)

  • Lossless: 24 MB (14% reduction)
  • Lossy (medium): 4 MB (86% reduction)

Technical manual with diagrams (original: 42 MB)

  • Lossless: 35 MB (17% reduction)
  • Hybrid (lossy images, lossless diagrams): 12 MB (71% reduction)

Scanned documents and photo collections compress dramatically. Text documents with vector graphics compress modestly.


Tips for better compression

Start with high-quality source files. You can always reduce quality later. You can't restore detail that was never there.

Know your output requirements. Compressing for email? 150 DPI is fine. Compressing for a print archive? Keep 300 DPI.

Use "Save As" instead of "Save." When editing PDFs, "Save As" writes a clean new file. "Save" appends changes, which can leave orphaned data.

Consider grayscale. If color isn't necessary, converting to grayscale reduces file size significantly.

Split large documents. If only certain pages have large images, split those out. Compress the image-heavy pages aggressively and keep the text pages at higher quality.

Compress after merging. If you've merged several PDFs into one file, the result is often larger than it needs to be. Run compression on the merged file rather than compressing each source file individually — you'll get better results.

Don't compress repeatedly. Each lossy compression pass degrades quality further. Compress once, from the original.


Email attachment limits

The most common reason to compress PDFs is email limits. Here's what you're working with:

  • Gmail: 25 MB (but encoding overhead means effective limit is ~18 MB)
  • Outlook: 20 MB
  • Yahoo: 25 MB
  • Protonmail: 25 MB

If your compressed PDF still exceeds these limits, upload it to cloud storage (Google Drive, Dropbox, OneDrive) and share a link instead.


Summary

"Compress PDF without losing quality" is possible when your PDF has removable overhead: metadata, duplicate objects, unoptimized fonts. This is lossless compression. Expect 20-50% reduction.

When your PDF is image-heavy, significant compression requires reducing image quality. This is lossy compression. The result can still look fine on screen, but zooming in or printing will show the difference.

The right approach depends on how the document will be used. For email and screen viewing, lossy compression at 150 DPI produces small files with no visible degradation. For archival or printing, stick with lossless or use minimal lossy settings at 300 DPI.

Online tools are fast but upload your files. Desktop tools keep files local. Browser-based tools like PDF-Builder offer both convenience and privacy.