Compress PDF Files Easily with Ghostscript
Have you ever tried to share a PDF only to find it's way too large to send? Large PDFs are a common headache — but there's a simple, free solution: Ghostscript. With a single command, you can dramatically reduce PDF file size without spending a dime.
What is Ghostscript?
Ghostscript is an open-source interpreter for PostScript and PDF. It's a battle-tested tool used for PDF compression, conversion, and rendering. It's completely free and supports Windows, Mac, and Linux.
Installation
Download the installer from the official site and run it.
After installation, the executable will be at:
C:\Program Files\gs\gs10.06.0\bin\gswin64c.exe
The Command
MSYS_NO_PATHCONV=1 "C:/Program Files/gs/gs10.06.0/bin/gswin64c.exe" \
-sDEVICE=pdfwrite \
-dCompatibilityLevel=1.4 \
-dPDFSETTINGS=/ebook \
-dNOPAUSE -dQUIET -dBATCH \
-sOutputFile="output.pdf" "input.pdf"
Note for Git Bash on Windows: Bash automatically converts paths like
/ebookinto Windows absolute paths, which breaks the command. PrependMSYS_NO_PATHCONV=1to prevent this.
Quality Settings
Adjust -dPDFSETTINGS to balance compression and quality:
| Option | Resolution | Best For |
|---|---|---|
/screen | 72 dpi | Screen viewing, smallest file size |
/ebook | 150 dpi | General documents, balanced quality |
/printer | 300 dpi | Print-ready documents |
/prepress | 300 dpi+ | Publishing, minimal compression |
For most use cases, /ebook is the sweet spot.
Results
| File | Size |
|---|---|
| Original | 724 MB |
| Compressed | 29 MB |
| Reduction | 96% |
Wrapping Up
Ghostscript is easy to install and takes just one command to compress a PDF significantly.
If quality matters, go with /printer. If size is the priority, try /screen.
Either way, it's one of the most effective free tools out there for PDF optimization.