Compress PDF Without Losing Quality: Tools & Methods
A 20 MB PDF that should be 800 KB is a common problem. Email attachments bounce, upload forms reject oversized files, and slow document downloads frustrate readers. Here is exactly how PDF compression works and how to get the smallest file size with no visible quality loss.
Why PDFs Get So Large
PDF files balloon in size for predictable reasons. Understanding the cause tells you exactly where to apply compression:
- Uncompressed or losslessly-compressed images: A scanner set to 600 DPI produces a high-res image that looks identical at screen zoom to a 150 DPI version. The extra resolution is pure wasted bytes when the document is read on screen.
- Embedded full fonts: PDF can embed entire font files. A single OpenType font can be 200–400 KB. A document using four fonts starts at 1+ MB before a single word of content.
- Duplicate objects: PDFs created by low-quality export pipelines often contain duplicate image objects, redundant resource dictionaries, and unreferenced objects left over from editing sessions.
- Embedded thumbnails and metadata: Adobe Acrobat and many other tools embed a full-resolution thumbnail of every page, plus XMP metadata, ICC color profiles, and document structure data that most readers never use.
- Version bloat: PDF is an incremental format. When you save changes in Acrobat, the old content is not deleted - it is appended. A document that has been edited multiple times can contain several complete copies of its content.
How PDF Compression Works: The Four Techniques
1. Image Resampling (Downsampling)
Images inside PDFs are stored at a specific resolution (dots per inch). Scanned documents often contain images at 300–600 DPI. A screen can display at most 96–150 DPI. Resampling reduces the image resolution to match the target output:
- Screen / web (72–96 DPI): For PDFs read on screen only. Maximum size reduction, some visible softening on close inspection.
- Ebook / email (150 DPI): The sweet spot. Indistinguishable from the original at normal viewing zoom. Reduces a 300 DPI scan to 25% of its original size.
- Print (300 DPI): Preserves print quality. Use for documents that will be physically printed.
This single technique typically provides 50–80% size reduction for scanned PDFs.
2. JPEG Re-encoding
Images inside PDFs may be stored as uncompressed bitmaps, lossless PNG, or already-compressed JPEG. Re-encoding to JPEG at 80–85% quality is typically invisible to the naked eye but can reduce image data by 60–70%:
# The JPEG quality scale:
# 100 = lossless (largest)
# 85 = visually lossless for most content
# 75 = slight compression artifacts on close inspection
# 60 = visible quality loss
# Target: 80-85 for "without quality loss"
For text-heavy PDFs with no photography, JPEG re-encoding provides less benefit. For PDFs containing photos, diagrams, or scanned pages, it is the most impactful single step.
3. Font Subsetting
Instead of embedding an entire font file, subsetting embeds only the characters actually used in the document. A document using 47 characters from a 2,000-glyph font embeds only those 47 glyphs, reducing the font data from ~300 KB to ~15 KB. For a document using four fonts, this alone can save over 1 MB.
4. Removing Metadata and Hidden Content
This includes:
- Embedded thumbnail images (one per page, added by Acrobat)
- XMP document metadata (author, title, creation tool, edit history)
- ICC color profiles (often 500 KB+, not needed for screen viewing)
- Unreferenced objects from incremental saves
- JavaScript and unused form data
- Linearization hints (for web-optimized PDFs, adds overhead)
Real-World Compression Results
Here is what to expect from a properly configured compression:
- Scanned document (300 DPI TIFF images): 18 MB → 1.2 MB (93% reduction) when resampled to 150 DPI + JPEG 85%
- PowerPoint-exported PDF with photos: 12 MB → 2.8 MB (77% reduction) with image optimization + font subsetting
- Text-only report with multiple fonts: 3.5 MB → 1.1 MB (69% reduction) with font subsetting + metadata removal
- Already-optimized PDF: 500 KB → 480 KB (4% reduction) - not much to gain when content is already efficient
Step-by-Step: Compress a PDF Online (No Software Needed)
- Open the SecureBin PDF Compressor.
- Drag and drop your PDF file or click to browse.
- Select your target quality: Screen (smallest file, screen-only), Ebook (recommended for most uses), or Printer (for print quality).
- Click Compress. Processing happens entirely in your browser - your file is never uploaded to any server.
- Download the compressed PDF. Compare the file size shown before and after.
Compress Your PDF Now - Free & Private
Reduce PDF size by up to 90% with no quality loss. Runs entirely in your browser. No upload, no account, no file size limits.
Open PDF CompressorCommand-Line Compression with Ghostscript
For batch processing or scripting, Ghostscript is the gold standard. It is free, open source, and available on Linux, macOS, and Windows:
# Screen quality (smallest file, ~72 DPI)
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 \
-dPDFSETTINGS=/screen -dNOPAUSE -dBATCH \
-sOutputFile=output.pdf input.pdf
# Ebook quality (recommended, ~150 DPI)
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 \
-dPDFSETTINGS=/ebook -dNOPAUSE -dBATCH \
-sOutputFile=output.pdf input.pdf
# Printer quality (300 DPI, for print)
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 \
-dPDFSETTINGS=/printer -dNOPAUSE -dBATCH \
-sOutputFile=output.pdf input.pdf
The -dPDFSETTINGS presets handle image resampling, JPEG quality, font subsetting, and metadata removal automatically. The /ebook preset is the recommended starting point.
Custom Ghostscript Settings
For more control, you can override individual settings:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 \
-dNOPAUSE -dBATCH \
-dDownsampleColorImages=true \
-dColorImageResolution=150 \
-dJPEGQ=85 \
-dEmbedAllFonts=true \
-dSubsetFonts=true \
-dCompressPages=true \
-sOutputFile=output.pdf input.pdf
Other Tools for PDF Compression
- Adobe Acrobat Pro: File → Reduce File Size or File → Optimize PDF. Best GUI for fine-grained control. Requires a subscription (~$20/month).
- Preview (macOS): File → Export as PDF → Quartz Filter → Reduce File Size. Very aggressive compression; often reduces quality too much. Use Ghostscript instead.
- img2pdf + Ghostscript: For scanned PDFs, extract images, optimize with
jpegoptimorpngquant, then reassemble withimg2pdf, then run through Ghostscript. - pdftk + Ghostscript: Use
pdftkto flatten form fields and remove annotations before Ghostscript compression.
Use Our Free Tool
For most users, the browser based approach is the fastest path to a smaller PDF. Use our free tool here → securebin.ai/tools/pdf-compressor/. No software to install, no file uploads, no data privacy concerns.
Frequently Asked Questions
What is the best PDF compression setting for email attachments?
The "Ebook" or 150 DPI setting is the right choice for email. It produces files that look identical on screen at normal zoom, passes through most email attachment size limits (10–25 MB), and opens correctly on all devices. The "Screen" setting at 72 DPI may look blurry if the recipient zooms in. "Printer" quality is unnecessarily large for documents that will not be printed.
Will compressing a PDF reduce text quality?
No. Text in PDFs is stored as vector data - mathematical descriptions of character outlines, not pixel images. Vector text is resolution-independent and is not affected by image compression settings. Only raster images (photos, scanned pages, diagrams) are affected by compression. If your PDF is text-only, compression mainly works through font subsetting and metadata removal.
Why is my PDF still large after compression?
Several reasons: (1) The images may already be efficiently compressed and cannot be reduced further. (2) The PDF may contain vector graphics that cannot be compressed the same way as raster images. (3) The PDF may contain embedded fonts that cannot be subsetted due to PDF permissions. (4) You may be targeting too high a quality setting - try the "Screen" preset to see the maximum possible reduction.
Does PDF compression affect digital signatures?
Yes. Any PDF transformation - including compression - invalidates existing digital signatures because the file's binary content changes. If a PDF has been digitally signed and the signature must remain valid, do not compress it. Sign the document after compression if both are required.
Is it safe to compress PDFs online?
It depends on the tool. Many online PDF tools upload your file to their servers for processing, which raises privacy concerns for sensitive documents (contracts, medical records, financial statements). Our PDF Compressor processes files entirely in your browser using PDF.js and PDF-lib. Your file never leaves your device.
Usman has 10+ years of experience securing enterprise infrastructure, managing high-traffic servers, and building zero-knowledge security tools. Read more about the author.