Understanding PDF compression on this page
PDFs mix vector text, fonts, embedded images, and metadata. Light cleanup rewrites the document with pdf-lib, clears common metadata fields, and saves with object streams — vectors stay vectors, so savings are often small if the file was already lean. Smaller file uses PDF.js to render each page and embeds JPEGs — often dramatic for scans and photo-heavy PDFs, but pages become images, so text can look softer and copy/search may suffer.
For a longer privacy-focused guide, read how to compress a PDF on the DoItSwift blog.
Light cleanup vs Smaller file
| Mode | Best for | Trade-off |
|---|---|---|
| Light cleanup | Forms, reports, crisp text | Often modest file reduction |
| Smaller file | Scans, photos, huge attachments | Lossy JPEG pages; check output before deleting originals |
Optional targets (max MB or shrink %) apply only in Smaller file mode; they trigger extra passes to approach your goal. If both fields are filled, max MB wins. Light cleanup ignores those fields.
How Much Can You Compress? Typical Results
| PDF type | Original size | Light cleanup | Smaller file (balanced) | Smaller file (maximum) |
|---|---|---|---|---|
| Text-heavy report (50 pages) | 2-5 MB | 1.5-4 MB (10-30%) | 1-2 MB (40-60%) | 500 KB-1 MB (70-80%) |
| Scanned document (20 pages) | 10-30 MB | 9-28 MB (minimal) | 2-5 MB (70-85%) | 1-3 MB (85-95%) |
| Photo-heavy presentation | 15-50 MB | 12-45 MB (10-20%) | 3-10 MB (60-80%) | 2-5 MB (80-90%) |
| Simple form / letter | 100-500 KB | 80-450 KB (5-15%) | Similar or slightly larger | Similar or slightly larger |
| Merged multi-source PDF | 5-20 MB | 4-15 MB (15-30%) | 2-5 MB (50-70%) | 1-3 MB (75-85%) |
Key insight: Light cleanup works best when the PDF has redundant metadata, duplicate fonts, or uncompressed object streams. Smaller file mode works best on scans and photo-heavy PDFs where rasterizing to JPEG yields dramatic savings. Already-optimized PDFs may not shrink much with either mode.
When You Need to Compress a PDF
Email attachment limits
Gmail caps attachments at 25 MB, Outlook at 20 MB, and many corporate email servers at 10 MB. Compress your PDF to fit within these limits instead of using external file-sharing links that may expire or require accounts.
Government and university portals
Online submission portals frequently limit uploads to 2-5 MB per file. Passport applications, visa forms, university admissions, job portals, and tax filing systems all impose strict size limits. Compress scanned documents to meet these requirements.
After merging multiple PDFs
Merged PDFs accumulate duplicate fonts and metadata from every source file, making the output larger than expected. A 5+3+4 MB merge can produce a 15 MB file instead of 12 MB. Compress after merging for significant savings — typically 30-60% reduction. Use our PDF Merger first, then compress the result.
Website and app uploads
CMS platforms, e-commerce product listings, and document management systems often have PDF size limits. Compressing PDFs before upload reduces storage costs and improves download speed for end users.
Archiving and backup
Compressing PDFs before archiving saves significant storage space over time. A company generating 100 PDFs/month at 5 MB each saves 30+ GB/year with even modest compression.
WhatsApp and messaging
WhatsApp limits document sharing to 100 MB, but large PDFs are slow to send on mobile data. Compressing scanned documents from 20 MB to 2-3 MB makes sharing instant even on slower connections.
Which Compression Mode Should You Use?
| Your PDF type | Recommended mode | Why |
|---|---|---|
| Contract or legal document | Light cleanup | Preserves text selectability and search |
| Scanned pages / receipts | Smaller file (balanced) | Already images — rasterizing loses nothing |
| Photo-heavy report | Smaller file (balanced) | Biggest gains on embedded photos |
| Tax / government form | Light cleanup | Must preserve form fields and text clarity |
| University assignment | Light cleanup first, Smaller file if still too large | Try preserving quality first |
| Portfolio / design work | Smaller file (custom, high quality) | Adjust quality slider to balance visuals vs size |
| Merged multi-document PDF | Light cleanup | Removes duplicate fonts and metadata from merge |
| Email attachment too large | Smaller file + target size | Set target to match email limit (e.g., 5 MB) |
General rule: Start with Light cleanup. If the result isn't small enough, try Smaller file at Balanced strength. Only use Maximum or set aggressive targets when file size matters more than visual quality.
How Browser-Based PDF Compression Works
Most PDF compressors (iLovePDF, Smallpdf, Adobe) upload your documents to cloud servers for processing. Your contracts, financial statements, identity documents, and medical records travel across the internet and are processed on someone else's infrastructure. For sensitive documents, this is a privacy risk.
DoItSwift compresses PDFs entirely in your browser:
Light cleanup mode
- The pdf-lib JavaScript library reads your PDF in browser memory
- It rewrites the document structure, removing redundant metadata and optimizing object streams
- Vector text, fonts, and images are preserved — the output is structurally identical but cleaner
- A new, smaller PDF is generated and offered for download
Smaller file mode
- PDF.js renders each page to an HTML Canvas at your specified quality
- Each rendered page is exported as a JPEG image at the selected compression level
- A new PDF is built from these JPEG pages using pdf-lib
- The result is typically 50-90% smaller but pages are now images (text becomes non-selectable)
Privacy proof: Disconnect your internet and try compressing a PDF. It works — because no server communication happens at any point. Server-based tools fail instantly when offline.
DoItSwift vs Other PDF Compressors
| Feature | DoItSwift | iLovePDF | Smallpdf | Adobe Acrobat Online |
|---|---|---|---|---|
| Files stay on device | Yes — never uploaded | No — server processed | No — server processed | No — Adobe cloud |
| Compression modes | 2 (Light + Raster with quality control) | 3 levels (no control) | 2 levels | 3 levels |
| Quality/sharpness control | Yes — sliders for both | No | No | No |
| Target file size | Yes — set max MB or min % reduction | No | No | No |
| Batch compression | Yes — unlimited | Limited (free tier) | 2/day free | Limited |
| Before/after comparison | Yes — per file | Yes | Yes | Yes |
| ZIP download | Yes | Yes | Limited | No |
| Works offline | Yes | No | No | No |
| Free tier limits | None — fully free | Daily caps | 2 tasks/day | Requires login |
Where DoItSwift wins: Privacy (no upload), quality control (adjustable sliders), target file size, and unlimited batch processing. No other popular compressor offers all four simultaneously.
Where others win: Server-based tools handle extremely large files (100+ MB) faster and can apply advanced compression algorithms that aren't available in browser JavaScript. Adobe Acrobat also preserves PDF/A compliance and metadata more reliably. For everyday compression of documents under 50 MB, DoItSwift is faster, more private, and offers more control.
Split, merge, or export images
Still too big? Try Split PDF and compress parts separately, or Merge PDF after shrinking pieces. To get pictures out of a PDF, use PDF to JPG.