GizmoBench guides
Privacy First: Compress PDFs Locally with Copy Paste Commands

Yes, you can compress PDFs entirely on your device without sending them to a server. For most people, the fastest first step is Preview on a Mac (one click, no install) or a local browser-based tool; anyone who needs a specific target size or more control should reach for Ghostscript or a tool like slimpdf.
TL;DR:
- Compressing PDFs on your device is possible using tools like Preview on Mac, Ghostscript, or browser-based apps, depending on your needs.
- Ghostscript offers precise control over image quality and resolution, but the majority of size reduction relies on image downsampling and re-encoding.
- For large photo-heavy files, pre-compressing images before creating the PDF can often yield better results than compressing the PDF afterward.
- Always verify compression quality by comparing file size, image clarity, and functionality of interactive elements before replacing the original.
- Over-compressing can make text unsearchable or destroy interactive features, requiring a gentler preset or separate image compression to fix.
Table of Contents
- Quick methods at a glance
- Compressing a PDF on a Mac with Preview
- Command-line compression with Ghostscript
- Local browser and desktop apps for one-off compression
- A safe workflow to verify results before replacing the original
- When compression breaks something, and how to fix it
- Try some local browser tools for document work
- Sources
- FAQ
Quick methods at a glance
The right method depends on your operating system, your comfort with technical tools, and what kind of PDF you’re compressing. A scanned contract full of images behaves very differently from a text-heavy report.
- Preview (macOS): one-click export, but limited to a handful of presets with no fine control.
- Ghostscript and slimpdf: command-line tools that give precise control over image quality, resolution, and target file size.
- Local browser tools and apps (including onadiet and GizmoBench’s utilities): convenient, no installation, and files never leave your device.
Before picking a method, open the PDF and ask whether it’s mostly scanned images or mostly text and vector graphics. Image-heavy files respond well to downsampling and re-encoding. Text and vector files often barely shrink unless you remove pages or strip metadata.
Compressing a PDF on a Mac with Preview
Preview’s built-in export tool is the quickest local option on macOS, and it needs no extra software.
- Open the PDF in Preview.
- Choose File, then Export.
- Set Format to PDF.
- Select the Quartz Filter dropdown and choose “Reduce File Size.”
- Click Save.
Apple notes that this filter’s results vary because it applies linearization and optimizes embedded images for screen viewing, which can include converting images to JPEG at a set quality level, so output size and visual quality depend heavily on what’s already in the PDF. If the default filter crushes image quality too much, ColorSync Utility lets you build or install a custom Quartz filter with your own image sampling and compression settings, which gives you a middle ground between doing nothing and moving to a command-line tool.
Pro Tip: Preview is fine for the occasional file, but if you’re compressing dozens of PDFs a week, a local app or a script will save more time than repeating the export dialog.
Command-line compression with Ghostscript
Ghostscript is the standard free tool behind most local PDF compression workflows, including many apps that wrap it in a friendlier interface. Its pdfwrite device converts a PDF using one of several built-in quality presets.

A typical command looks like this:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dBATCH -sOutputFile=small.pdf original.pdf
The /ebook preset targets a moderate balance of size and quality, suitable for on-screen reading. Ghostscript also offers /screen for the smallest files and lowest quality, /printer for higher-resolution output meant for local printing, and /prepress for print production where color accuracy matters more than file size.
- Most of the size reduction comes from downsampling embedded images and re-encoding them, not from changes to text or vector content.
- Choose the preset based on where the PDF is going (screen, office printer, professional press) rather than chasing the smallest possible file.
- Install Ghostscript only from its official project or your operating system’s trusted package manager, and always keep the original file before running any batch job.
Ghostscript’s documentation confirms that image downsampling and encoding settings, not text compression, account for most of the size difference between presets, which is why an already-optimized scan may not shrink much no matter which preset you choose (Ghostscript optimization guide).
Tools like slimpdf and pdfsizeopt sit on top of similar ideas: slimpdf lets you request a target size directly, while pdfsizeopt focuses on shrinking PDFs generated from TeX or LaTeX without touching interactive elements (pdfsizeopt project).
Local browser and desktop apps for one-off compression
Not everyone wants a terminal. A growing set of local-first apps and browser tools handle compression without ever transmitting your file.
- onadiet (diet) shrinks PDFs and images on your own machine toward a size you specify, such as
--to 5mb, and writes the result next to the original file rather than overwriting it. If it can’t improve the file, it keeps the original untouched, which protects against accidental data loss in automated workflows. - slimpdf supports the same target-size idea through a
--targetflag, running entirely offline and reporting whether it actually hit the number you asked for (slimpdf README). - Pico-style desktop apps, including open-source projects like compress[pdf] with Finder integration on macOS, offer quality sliders and batch processing for users who want a graphical interface rather than a command line (PDFCompressor project).
Pro Tip: If your file is mostly large photos rather than scanned pages, compressing the images before you build the PDF, using something like the Image Resizer, often beats compressing the finished document.
A safe workflow to verify results before replacing the original
Compression is not risk-free: it can degrade images, rasterize text, or strip interactive elements if you push it too hard. A short verification routine catches problems before you delete the original.
- Copy the original file and note its size and page count.
- Run the compression into a new filename, never overwriting the source.
- Compare the before-and-after file sizes.
- Zoom into a few representative pages, including any with fine text or detailed images.
- Confirm that text is still selectable and that links, form fields, and signatures still work.
This mirrors the verification approach documented for production PDF pipelines: check image quality at multiple zoom levels and confirm interactive features survive the process before trusting a compressed file (Ghostscript devices documentation).
| Step | What to check | Why it matters |
|---|---|---|
| Copy original | Size and page count | Gives you a baseline and a fallback |
| Compress to new file | Resulting size | Confirms the tool actually reduced size |
| Zoom inspection | Image sharpness | Catches over-aggressive downsampling |
| Function check | Text, links, forms, signatures | Confirms nothing important was stripped |
If a portal still rejects the file after compression, target-size tools like slimpdf or onadiet are worth a second attempt before you resort to splitting the document or removing pages you don’t need. A partner tool like Pingfloat’s PDF combiner can help if you need to reassemble sections after splitting a file to meet a limit.
When compression breaks something, and how to fix it
Over-compression tends to show up in a few predictable ways: text that used to be selectable turns into a flat image, form fields stop responding, or embedded signatures disappear. These symptoms usually mean the tool rasterized a page instead of just re-encoding its images.
- Rasterizing a page is fine for a final, visual-only export, but it’s a problem for anything that needs OCR, accessibility, fillable forms, or searchable text.
- If selectable text vanishes, rerun the compression with a gentler preset, such as
/printerinstead of/screenin Ghostscript, or raise the maximum image DPI setting. - If image quality looks noticeably worse than the source, try a different encoder setting or reduce the compression target incrementally rather than jumping straight to the smallest option.
- When the source images themselves are the problem, compressing them separately with a tool such as Zyff’s image compressor before rebuilding the PDF can produce a cleaner result than compressing the whole document at once.
Try some local browser tools for document work
Some local browser tools run directly in your browser, so files never leave your device, there’s no account to create, and nothing to install. That matters most when the PDF you’re shrinking contains anything sensitive, since the processing happens on your own machine rather than on a remote server.
- Use the Markdown to PDF tool if you’re generating a PDF from Markdown in the first place, which lets you control formatting before compression becomes necessary.
- Preview the source content first with the Markdown Viewer if you want to check formatting before exporting to PDF.
- After compressing, check image fidelity at high zoom using the Dead Pixel Test approach to screen inspection, or resize source images cleanly with the Aspect Ratio Calculator before embedding them.
Some core tool functions are free to use and need no account, though not every feature across similar catalogs is guaranteed to stay free indefinitely. Browse the full set of everyday tools to find the one that fits your document workflow, and verify each tool’s current capabilities on its own page before relying on it for a specific task.
Sources
- Reduce the size of a PDF in Preview on Mac
- Optimizing PDFs with Ghostscript
- slimpdf README
- onadiet skill documentation
- PDFCompressor (compresspdf)
FAQ
Is there a free PDF compressor?
Yes, several free options exist, including Preview on macOS, the open-source Ghostscript command-line tool, and browser-based tools that run locally without an account. Most of these handle everyday compression needs without any cost or upload step.
Can ChatGPT compress a PDF?
Not directly on your device: ChatGPT is a cloud-based service, so any file you share with it leaves your local machine, which defeats the purpose of local-only compression. For privacy-first compression, tools like Preview, Ghostscript, or browser-based local apps keep the file on your computer the entire time.
Is there a free offline PDF compressor I can download?
Yes, Ghostscript is a free, open-source command-line tool that compresses PDFs entirely offline once installed, and projects like slimpdf and compress[pdf] offer the same offline approach with a simpler interface. macOS users already have Preview built in, which requires no download at all.
What can I do if the PDF file is too large?
Try a target-size tool like slimpdf or onadiet, which iterate toward a requested size instead of relying on a single preset. If that still doesn’t hit the limit, consider splitting the document or removing unnecessary pages rather than compressing images so aggressively that text or forms stop working.