Get your API key
How to compress PDF for email (under 10 MB in seconds)

How to compress PDF for email (under 10 MB in seconds)

Compress a PDF for email in seconds with no quality loss. Covers email size limits, free browser tools, Ghostscript, and Python one-liners. 2026 guide.

8 min read

Most email providers cap attachments at 20-25 MB. A single scanned report, design export, or photo-heavy presentation can easily exceed that. The fix is compressing the PDF before sending, reducing file size by 50-85% while keeping the document perfectly readable.

This guide covers the fastest free methods, what causes large PDFs, and how to automate compression for recurring workflows.

What causes a PDF to be too large for email

The dominant cause of oversized PDFs is raster image content. Images embedded at print resolution (300 DPI or higher) contain 4x more pixels than needed for screen viewing. A single full-page photo at 300 DPI takes several MB; at 150 DPI the same image takes under 1 MB.

Content typeCompression potentialExplanation
Scanned pages (raster)70-85%High-res scans are the biggest offender
Embedded photos60-80%Print-res images downsampled to screen DPI
Charts and diagrams (vector)5-15%Vectors don't benefit much from DPI reduction
Text and fonts10-30%Lossless only: font subsetting, stream compression
Pure text, no images10-20%Already compact, limited room to compress

Reducing image resolution to 150 DPI for email is the single most effective step. At 150 DPI, text and most graphics remain sharp on a screen; the difference only becomes visible when zooming above 200%.

Email attachment size limits by provider

Every major email provider enforces a maximum attachment size. If your PDF exceeds the limit, the email is rejected or held:

Email providerAttachment limitNotes
Gmail25 MBOffers automatic Google Drive link above limit
Outlook / Microsoft 36520 MBExchange Online policy; on-premise may differ
Yahoo Mail25 MB
Apple iCloud Mail20 MB
ProtonMail25 MB (free), no limit (paid)
Zoho Mail20 MB

For enterprise email systems using Exchange Server, limits are set by the server admin and may be as low as 10 MB. When in doubt, target under 10 MB to ensure reliable delivery.

Method 1: Free browser tool (no upload, no signup)

The fastest way to compress a PDF for email is to use a browser-based tool that processes files locally:

  1. Go to Compress PDF with a 10 MB target
  2. Drop your PDF onto the upload area
  3. The target size option (under Advanced options) keeps compressing with stronger settings until the file fits under 5, 10, or 25 MB, and tells you if the target cannot be reached
  4. Download the result (shows new size and reduction %)

Your file never leaves your device. The tool recompresses the images embedded inside the PDF in place, so text stays selectable and searchable. This is the safest option for confidential documents.

Typical processing time: 2-10 seconds for a 10-page document.

Method 2: Ghostscript (best for batches and scripts)

Ghostscript is the most powerful free PDF compressor and handles batch processing reliably. The /ebook preset is the standard choice for email:

gs -sDEVICE=pdfwrite \
   -dCompatibilityLevel=1.5 \
   -dPDFSETTINGS=/ebook \
   -dNOPAUSE -dBATCH -dQUIET \
   -sOutputFile=compressed.pdf input.pdf

The Ghostscript documentation for PDF settings defines four quality presets:

PresetDPITypical use case
/screen72Smallest possible, screen-only viewing
/ebook150Email and web sharing (recommended)
/printer300High-quality print
/prepress300+Archival, maximum fidelity

For email, /ebook hits the right balance. At 150 DPI, text-heavy PDFs look identical to the original on any modern monitor; scanned documents remain fully legible.

Batch compress an entire folder

for f in *.pdf; do
  gs -sDEVICE=pdfwrite \
     -dPDFSETTINGS=/ebook \
     -dNOPAUSE -dBATCH -dQUIET \
     -sOutputFile="compressed_${f}" "$f"
done

Method 3: Python one-liner

If you already have Python installed, the simplest approach calls Ghostscript via subprocess:

import subprocess
from pathlib import Path
 
def compress_for_email(input_path: str, output_path: str, dpi: str = "ebook") -> None:
    """Compress a PDF to email-friendly size using Ghostscript."""
    subprocess.run(
        [
            "gs",
            "-sDEVICE=pdfwrite",
            f"-dPDFSETTINGS=/{dpi}",
            "-dNOPAUSE",
            "-dBATCH",
            "-dQUIET",
            f"-sOutputFile={output_path}",
            input_path,
        ],
        check=True,
    )
    original = Path(input_path).stat().st_size
    compressed = Path(output_path).stat().st_size
    reduction = (1 - compressed / original) * 100
    print(f"Reduced {original / 1e6:.1f} MB → {compressed / 1e6:.1f} MB ({reduction:.0f}% smaller)")
 
compress_for_email("report.pdf", "report-email.pdf")

This approach works well in CI pipelines and automated document workflows where PDFs need to be email-ready before being sent.

Method 4: macOS Preview (zero install)

On macOS, the built-in Preview app compresses PDFs without any extra software:

  1. Open the PDF in Preview
  2. File > Export as PDF
  3. Set Quartz Filter to "Reduce File Size"
  4. Save

The Reduce File Size filter applies aggressive compression (equivalent to /screen in Ghostscript). It works well for reducing very large files but may over-compress at 72 DPI. Use Ghostscript if you need more control over quality.

What to do if the PDF is still too large

Some PDFs resist compression because their images are already optimized or the content is mostly vector. In those cases:

Split the PDF into smaller parts

If the document has distinct sections (chapters, months, departments), split it into smaller files and send in separate emails. Each recipient gets only the pages relevant to them.

Remove unnecessary pages before compressing

Review the document and remove pages you don't need to send. Fewer pages means smaller file regardless of compression.

Gmail automatically offers a Google Drive upload link when you attach a file over 25 MB. Dropbox, OneDrive, and iCloud Drive offer similar functionality. Sharing a link sidesteps the attachment size limit entirely, and the recipient gets the full-quality original.

Optimize PDFs at generation time

If you generate PDFs programmatically (invoices, reports, certificates), producing lean output from the start avoids the need to compress afterward. Common causes of bloat in generated PDFs:

  • Base64-encoded images larger than their display size
  • Full font files instead of subsetted fonts (a 300 KB typeface subsetted to the glyphs actually used weighs 15-30 KB, a 90%+ reduction measured by web.dev)
  • Embedded preview thumbnails

PDF4.dev subsets fonts automatically and avoids embedding preview metadata, producing compact PDF output without a separate compression step.

Typical results for email-targeted compression

The table below shows real-world compression results at the /ebook (150 DPI) preset:

Document typeBeforeAfterReduction
10-page scanned report (300 DPI)18 MB2.8 MB84%
20-page presentation with photos32 MB7.1 MB78%
50-page text report with charts8 MB3.2 MB60%
5-page invoice (text + logo)450 KB310 KB31%
Already-compressed export3 MB2.9 MB3%

Results vary by image resolution, existing compression, and content type. Text-only PDFs compress the least; scanned documents compress the most.

If you generate PDFs from HTML templates (invoices, reports, certificates), PDF4.dev produces compact output by default. No compression step needed. Try it free.

Automating email-ready PDF compression

For teams that send PDFs regularly (weekly reports, monthly invoices, client deliverables), setting up a one-command compression step saves time and prevents "attachment too large" bounce-backs.

A simple shell alias does the job:

# Add to ~/.zshrc or ~/.bashrc
alias compress-email='f() { gs -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -dNOPAUSE -dBATCH -dQUIET -sOutputFile="${1%.pdf}-email.pdf" "$1"; }; f'
 
# Usage
compress-email quarterly-report.pdf
# Produces: quarterly-report-email.pdf

For a more complete workflow that compresses and checks the output size:

import subprocess
import sys
from pathlib import Path
 
TARGET_MB = 10  # email-safe limit
 
def compress_for_email(src: str) -> str:
    src_path = Path(src)
    out_path = src_path.with_stem(src_path.stem + "-email")
 
    subprocess.run(
        ["gs", "-sDEVICE=pdfwrite", "-dPDFSETTINGS=/ebook",
         "-dNOPAUSE", "-dBATCH", "-dQUIET",
         f"-sOutputFile={out_path}", str(src_path)],
        check=True,
    )
 
    size_mb = out_path.stat().st_size / 1e6
    if size_mb > TARGET_MB:
        print(f"Warning: output is {size_mb:.1f} MB (still above {TARGET_MB} MB). Consider /screen preset or splitting.")
    else:
        print(f"OK: {size_mb:.1f} MB — ready for email.")
    return str(out_path)
 
if __name__ == "__main__":
    compress_for_email(sys.argv[1])

Choosing the right compression level

The right preset depends on how the recipient will use the document:

ScenarioRecommended presetDPI
Email attachment for screen reading/ebook150
Email for archiving (no printing)/screen72
Email that will be printed/printer300
Internal reference document/ebook150
Legal or compliance documentOriginal or /printer300+

When in doubt, use /ebook (150 DPI). It hits under 10 MB for most documents while remaining fully legible on screen and acceptable for standard printing.

Summary

To compress a PDF for email:

  1. Use PDF4.dev's free compress tool for a one-off file (no signup, files stay local)
  2. Use Ghostscript with -dPDFSETTINGS=/ebook for batches and scripts
  3. Target 150 DPI for the right balance of size and quality
  4. If still too large: split pages or share via a cloud link

For teams generating PDFs programmatically, producing lean output at the source (font subsetting, no embedded thumbnails) is more efficient than compressing after the fact.

Free tools mentioned:

Compress PdfTry it freeMerge PdfTry it freeSplit PdfTry it free

Frequently asked questions

What is the maximum PDF size I can send by email?
Gmail allows attachments up to 25 MB. Outlook and Microsoft 365 allow up to 20 MB. Yahoo Mail allows up to 25 MB. Apple Mail is limited by your email provider, typically 20-25 MB. If your PDF exceeds these limits, compress it or share via a cloud link instead.
How do I reduce a PDF size for email without losing quality?
Use 150 DPI resampling (the 'ebook' preset in Ghostscript or the default in most browser tools). At 150 DPI, text and charts remain visually sharp on screen. Only zooming in above 200% reveals any difference. For text-only PDFs, lossless compression maintains full quality with 10-30% size reduction.
Why is my PDF too large to send by email?
The most common causes are: high-resolution images embedded in the PDF (common in design exports and scanned documents), full (unsubsetted) font files, and embedded thumbnails or metadata. Image content is the dominant contributor in most cases.
Can I compress a password-protected PDF for email?
Most compression tools cannot process encrypted PDFs. Remove the password first using an unlock tool, compress, then re-protect if needed.
Does compressing a PDF for email affect how it prints?
At 150 DPI (the recommended email preset), printed output looks fine at A4/Letter size. At 72 DPI (screen preset), images may look slightly soft when printed at full size. Use 150 DPI or higher if the recipient might print the document.
What if my PDF is still too large after compression?
Try splitting the PDF into smaller files, removing unnecessary pages, or uploading to Google Drive or Dropbox and sharing a link instead. Gmail automatically offers a Google Drive link when an attachment exceeds 25 MB.
Is it safe to compress PDFs online for email?
PDF4.dev's compression tool processes files entirely in your browser using JavaScript. Your PDF is never uploaded to any server. This is the safest option for sensitive documents like contracts or financial reports.
How much can I reduce a PDF for email?
Scanned documents and photo-heavy PDFs typically compress 70-85%. A 15 MB scanned report often reduces to under 3 MB. Text-heavy PDFs with few images compress 20-40%. The actual result depends on image resolution and whether images were already compressed.
What is the best tool to compress PDF for email?
For a quick one-off compression with no signup, use PDF4.dev's free browser-based tool. For batch processing or automation, use Ghostscript with the /ebook preset (150 DPI). For Python scripts, the subprocess call to gs is the most reliable option.
Will compressing a PDF change its content or formatting?
No. Text, fonts, vector graphics, and page layout are unchanged. Compression only affects raster images (photos, scanned content), which are resampled to a lower resolution.

Start generating PDFs

Build PDF templates with a visual editor. Render them via API from any language in ~300ms.