How to Reduce PDF File Size
Why PDFs get large and how to shrink them without losing quality
PDF files balloon in size for several reasons — embedded high-resolution images, redundant internal objects, uncompressed fonts, or bloated metadata from export tools. Here are three effective ways to reduce PDF file size, from a quick browser tool to a command-line approach that can achieve dramatic reductions.
Method 1: Using Papiral (instant, no software, lossless)
The fastest option for reducing PDF size without affecting content quality.
- 1Go to the Compress PDF tool on Papiral.
- 2Upload your PDF or a ZIP of multiple PDFs.
- 3Click Process — Papiral re-serializes the PDF using object stream compression, removing internal redundancy.
- 4Download the smaller PDF or ZIP.
Papiral's compression is completely lossless. Text, images, and fonts are untouched — only the internal PDF structure is optimised. Typical size reduction: 5–30%.
Method 2: Ghostscript (command line, deeper compression for image-heavy PDFs)
Ghostscript can re-encode embedded images, achieving much larger reductions — at the cost of some image quality.
- 1Install Ghostscript: brew install ghostscript (Mac) or apt install ghostscript (Linux).
- 2Run the command below, choosing the quality setting that suits your use case.
- 3The output file will be saved as output.pdf.
bash
# Balanced (good for email and web sharing)
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 \
-dPDFSETTINGS=/ebook -dNOPAUSE -dBATCH \
-sOutputFile=output.pdf input.pdf
# Maximum compression (lower image quality)
# Replace /ebook with /screen
# High quality (for printing)
# Replace /ebook with /printerUse /screen for the smallest files (email attachments), /ebook for balanced quality, /printer when you need to preserve image quality for printing.
Method 3: Python with pikepdf
A lightweight Python approach for programmatic size reduction.
- 1Install pikepdf: pip install pikepdf
- 2Use the script below to recompress and save a smaller PDF.
python
import pikepdf
with pikepdf.open("input.pdf") as pdf:
pdf.save(
"output.pdf",
compress_streams=True,
object_stream_mode=pikepdf.ObjectStreamMode.generate,
)
print("Saved compressed PDF.")ObjectStreamMode.generate tells pikepdf to group PDF objects into compressed streams — the same technique Papiral uses internally.
Frequently asked questions
Why is my PDF so large if it only contains text?
Text-only PDFs can still be large if they embed full font files (especially CJK fonts), contain unnecessary metadata, or were exported with redundant internal objects from tools like Word or InDesign. Lossless compression usually helps significantly in these cases.
What is the biggest factor in PDF file size?
Embedded images are almost always the largest contributor. A PDF with high-resolution photos at 300 dpi can be tens of megabytes. Re-encoding images at a lower resolution (using Ghostscript) is the most effective way to achieve dramatic size reductions.
Is there a way to reduce PDF size without any quality loss?
Yes — lossless structure compression (like Papiral's Compress tool or pikepdf) removes internal redundancy without touching content. The result looks identical to the original. For larger reductions, image re-encoding (lossy) is needed.
Ready to try the fastest method?
Reduce PDF file size by re-saving with optimized structure. No quality settings required — just smaller files.
Compress PDF — free
Papiral
Tabular