Skip to content

Compress a PDF on Windows Free Without Uploading It

Compress a PDF on Windows free using WSL and Ghostscript — no uploading to a website. Pick the right quality preset, shrink scanned PDFs, and keep the file fully local.

MGMCSA Guru Team June 16, 2026 3 min read
A WSL terminal compressing a PDF with Ghostscript on Windows, showing the smaller output file size

The email bounces because the PDF is 40 MB. The first search result is a website that wants you to upload it — which is the last thing you want to do with a contract, a bank statement, or a scan of your passport. Handing a confidential document to a free converter just to shave off some megabytes is a bad trade.

Ghostscript in WSL compresses PDFs locally, for free, with one command. It downsamples the embedded images (where almost all the bloat lives) while leaving text crisp, and the file never leaves your machine.

If you don’t have WSL, set it up with the WSL install guide.

Install Ghostscript

sudo apt update && sudo apt install -y ghostscript

The command is gs. Confirm it:

gs --version

The command

This is the core of it — compress input.pdf into output.pdf:

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

The piece that controls the size/quality trade-off is -dPDFSETTINGS. Everything else is boilerplate (-dNOPAUSE -dBATCH -dQUIET just stop it from prompting and printing noise).

Choosing the right preset

-dPDFSETTINGS picks a target image resolution. This is the dial that matters:

-dPDFSETTINGS presets

/screen Smallest file, ~72 dpi images — can look rough
/ebook Best all-round balance, ~150 dpi
/printer Higher quality, ~300 dpi, larger file
/prepress Highest quality, ~300 dpi, color-preserving
/default General-purpose, leans toward quality

Start with /ebook. It usually gives a real size drop with images that still look fine on screen. Drop to /screen only if you need the absolute smallest file and can accept softer images.

Check the before and after

Always confirm the saving — and that the output still looks right:

ls -lh input.pdf output.pdf

-lh prints human-readable sizes side by side. Open output.pdf and skim a few pages, especially any with photos or fine detail, before you send it.

Compress several PDFs

To run the same compression across every PDF in a folder, into a compressed subfolder:

mkdir -p compressed
for f in *.pdf; do
  gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dBATCH -dQUIET -sOutputFile="compressed/$f" "$f"
done

Originals stay where they are; the smaller copies land in compressed/.

When compression barely helps

If the result is hardly smaller, the PDF is probably mostly text or already-optimized images — there’s little for Ghostscript to remove. The big wins come from PDFs stuffed with large photos or high-resolution scans.

Wrapping up

Compressing a PDF on Windows is one Ghostscript line with one meaningful choice: the -dPDFSETTINGS preset. Use /ebook for the everyday balance, /screen when you need the smallest file, and check the result with ls -lh before sending.

It’s free, it batches, and it runs in WSL — so your contracts, statements, and scans never get uploaded to a compressor site. To split a large PDF down to just the pages you need (often smaller than compressing the whole thing), see split a PDF into separate pages.

Frequently asked questions

How does Ghostscript actually shrink a PDF?

Most of a large PDF's size is embedded images. Ghostscript downsamples and recompresses those images to a target resolution set by the -dPDFSETTINGS preset. Text and vector content stay sharp, so the saving comes almost entirely from the images.

Which -dPDFSETTINGS preset should I use?

/ebook is the best balance for most documents — a clear size drop with readable images. /screen is smallest but can look rough. /printer and /prepress keep higher image resolution for printing. Try /ebook first and only switch if the result is too soft or too large.

Does compressing a PDF make the text blurry?

No. Text in a normal PDF is vector or font data, which Ghostscript preserves. Only embedded images are downsampled, so the text stays crisp. A scanned PDF is different — the whole page is an image, so heavier presets will soften it.

Is my PDF uploaded anywhere?

No. Ghostscript runs locally in WSL, so the PDF never leaves your machine. That's the main reason to use it over an online compressor, especially for contracts, statements, or anything confidential.

The compressed PDF is barely smaller — why?

If the PDF is mostly text or already-optimized images, there's little to remove, so the size barely changes. Compression mainly helps PDFs full of large photos or high-resolution scans. For those, the difference can be substantial.

Sources & further reading

Official vendor documentation referenced while writing this guide.

MG

MCSA Guru Team

IT & Systems Administration

We are working IT pros and system administrators who spend our days in Windows Server, Microsoft 365, and the wider Microsoft stack. MCSA Guru is where we write down the fixes and walkthroughs we wish we had found the first time.

MCSA Guru provides independent, educational IT guidance. Microsoft, Windows, Windows Server, Microsoft 365, Exchange, and Microsoft Teams are trademarks of Microsoft Corporation; Docker is a trademark of Docker, Inc. MCSA Guru is not affiliated with or endorsed by Microsoft or Docker. Always test changes in a safe environment before applying them in production.

Related guides

Fixing something right now?

Jump straight into the guide library or search for the exact error or task you are dealing with.