📄 PDF Compressor
Compress PDF files right in your browser — your files never leave your device
Drag & drop PDF files here
or click to browse — PDF files up to 50 pages recommended
How PDF Compression Works
PDF compression reduces file size by re-encoding the content more efficiently. This tool uses a two-step process: rendering each page to an image, then rebuilding the PDF with JPEG-compressed images.
How It Works Under the Hood
Traditional PDF files often contain large embedded images, fonts, and metadata that take up significant space. This compression tool uses a unique approach:
- Parse — The original PDF is loaded using PDF.js, which reads the file and extracts each page as a separate renderable object.
- Render — Each page is drawn onto an HTML canvas at a moderate resolution (150 DPI). This captures all content: text, images, vector graphics, and layout.
- Encode — The canvas is converted to a JPEG image using
canvas.toBlob()at your chosen quality level. JPEG is highly efficient for photographic content and works well for most PDF pages. - Rebuild — A brand new PDF is created using pdf-lib, with each compressed JPEG image embedded as a full-page element. The result is a clean, optimized PDF.
The rendering scale of 1.5x (150 DPI) provides an excellent balance between visual quality and file size. Text remains fully readable while image content gets significantly compressed.
Compression Ratio Formula
The compression ratio tells you how much space you saved:
For example, if a 5 MB PDF compresses to 1.5 MB, the compression ratio is (1 − 1.5/5.0) × 100% = 70%.
When to Use Each Quality Level
- 85-100%: Professional documents, presentations, text-heavy PDFs — text stays crisp, minimal artifacts
- 60-84%: General purpose web PDFs, email attachments — excellent balance of quality and size
- 40-59%: Archive copies, internal documents — noticeable JPEG artifacts but still readable
- 10-39%: Maximum compression — significant quality loss, use only when file size is the top priority
Why Browser-Based PDF Compression Matters
Most online PDF compressors require uploading your document to a remote server, which raises privacy and security concerns — especially for sensitive documents like contracts, resumes, or financial records. This tool uses PDF.js and pdf-lib to process everything within your browser. Zero data ever leaves your device. No server upload, no cloud processing, no storage of your files.
Step-by-Step Guide
- Upload your PDF — Drag and drop or click to select one or more PDF files. Each file is processed independently.
- Adjust quality — Use the slider to set JPEG compression quality (10-100%). Lower values = smaller files but more artifacts.
- Wait for processing — Each page is rendered and compressed. Progress is shown per page. Larger PDFs take longer.
- Download — Once complete, download your compressed PDF. The original file is never modified.
Frequently Asked Questions
No. All compression happens entirely in your browser using PDF.js and pdf-lib libraries. Your PDF files never leave your device — no server upload, no cloud processing, no storage.
PDF compression results vary depending on the content. Text-heavy PDFs with primarily text content compress modestly (10-20%). PDFs with high-resolution images compress dramatically (50-80%) by re-encoding images as JPEG at the selected quality level.
This tool renders each PDF page to a canvas and re-encodes it as JPEG images embedded in a new PDF. At 75-85% quality, the visual difference is minimal for most documents. For text-heavy documents, use 85%+ quality to keep text crisp. Image-heavy PDFs can use lower quality settings for substantial size savings.
Since everything runs in your browser, the practical limit depends on your device's memory. Very large PDFs (100+ pages or 50+ MB) may cause performance issues. For best results, compress PDFs up to 30 MB or 50 pages at a time.