Processed in your browser · not uploaded for processing

Compress PDF Files Online

Keep text selectable, or shrink it as an image

Smart mode repackages the PDF while keeping its text layer intact. Image mode renders pages to JPEGs at the DPI and quality you choose, giving you more control over the size-versus-quality trade-off.

See how it works
Smart or Image mode DPI & quality control PDF processed in your browser
Built & maintained by Bhavin J. Sheth | Updated

Compress your PDF

Upload a PDF, choose a mode and settings, and process it directly in your browser.

Drop your PDF here

or browse files

How compression works

Every smaller PDF involves a trade-off

Smart mode repackages PDFs while keeping text selectable. Image mode renders pages as compressed JPEGs to maximize size reduction.

Two different mechanisms

Contracts and text-heavy reports need to stay searchable and copyable, so shrinking them shouldn't disrupt the text layer. Scanned files are already pixel-based, so converting them to compressed JPEGs reduces file size significantly.

Smart mode repackages the PDF structure so existing text remains selectable and searchable. Image mode renders each page to a JPEG image at the quality and resolution you choose, offering higher size reductions.

Every control and what it changes

Smart (text kept)

Repackages pages without rasterizing them, keeping text selectable and searchable.

Image mode

Renders pages as JPEG images for higher file-size reduction, with text no longer selectable.

DPI and quality level

DPI controls pixel density; quality sets JPEG compression. Together they define image sharpness.

Pages to include

Include only specific page ranges in the output to keep file size smaller.

Metadata removal

Strips common document properties and metadata fields.

Four steps, choose the right balance

Choose the mode first, then adjust quality, DPI, metadata, and page selection for the output you need.

1

Upload your PDF

Drag it onto the upload area or click Select PDF. The document renders immediately in your browser.

Original file size is displayed after processing finishes.
2

Choose mode and settings

Decide what you need:

Smart: keep text selectable while repackaging the PDF.
Image: pick a quality level and DPI for maximum file-size reduction.
Optionally narrow down to a page range or remove metadata.
3

Compress

Click Compress PDF. A progress bar tracks page rendering in Image mode.

Cancel processing anytime if needed.
4

Check and download

Compare original and compressed sizes, review the page preview, and save your file.

Quality preview Size comparison

What image compression can achieve

Example of image compression applied to a scanned report.

Original document Example: 6.28 MB
Scanned PDF document before compression showing large file size

Large files can run into attachment, upload, or sharing limits.

Compressed
After compression Example: 318.59 KB
Same PDF document after compression showing reduced file size

Smaller output with page quality determined by the selected DPI and JPEG quality.

When PDF compression is useful

Situations where file size limits make compression necessary.

Common situations for compressing PDF files
SituationRecommended approach
Email attachmentsWhen an email service has a strict size limit, Image mode can help reduce large scanned PDFs before attaching them.
Contracts & legal filingsText needs to remain selectable for search and citation — Smart mode preserves the text layer without rasterizing.
Portfolios & resumesWhen a job application portal has a strict file upload cap, Image mode helps keep resumes or portfolios within limits.
Scanned archivesScanned pages respond well to image compression, with final quality governed by your chosen DPI and JPEG quality settings.
Website downloadsSmaller PDFs require less data to download, reducing transfer time and bandwidth usage for site visitors.
Cloud storage limitsReducing unnecessarily large PDFs helps manage shared or personal storage quotas more efficiently.
Compression modes & levels

How each compression mode and level changes your PDF

Smart keeps text selectable, while Image mode uses JPEG compression at four quality levels.

Basic

The highest-quality preset, using JPEG quality 0.90. It usually preserves more image detail while producing less aggressive size reduction.

Recommended

Uses JPEG quality 0.75 as the default balance between visual detail and file size.

High

Uses JPEG quality 0.50 to produce a smaller file with more noticeable quality loss — well suited to screen viewing or internal drafts.

Extreme

Uses JPEG quality 0.30 as the most aggressive preset, prioritizing file-size reduction over image quality.

When the output isn't what you expected

Common issues and how to resolve them quickly.

Symptom
Why it happens
Fix

Output looks blurry

DPI is set too low or the compression level is too aggressive.

Raise DPI to 150 or 300, or switch to Basic or Recommended level.

File got larger, not smaller

The source PDF was already heavily optimized or very small.

Try Smart mode, a stronger compression level, or include fewer pages in the output.

Text isn't selectable anymore

Image mode was used, converting pages to JPEGs without a text layer.

Re-run using Smart mode if selectable text is required.

Compression takes a while

Large multi-page PDFs at high DPI take longer to render.

Lower DPI, or include fewer pages in the output.

Won't compress

The PDF may be encrypted, password-protected, corrupted, or unsupported by browser libraries.

Try an unencrypted copy or open and re-save the PDF before compressing.

Output looks blurry

Why: DPI too low or level too aggressive.

Fix: Raise DPI or use Basic/Recommended.

File got larger

Why: Source was already optimized.

Fix: Try Smart mode or include fewer pages in the output.

Text not selectable

Why: Image mode was used.

Fix: Switch to Smart mode.

Compression is slow

Why: Many pages at high DPI.

Fix: Lower DPI or include fewer pages in the output.

Won't compress

Why: Encrypted or unsupported PDF.

Fix: Try an unencrypted copy.

Practical compression tips

A practical order of steps to get the result you need on the first try.

Start with Recommended

It provides a balanced default for most files — only move to High or Extreme if the file is still too large.

Use Smart mode for text documents

Contracts, reports, and ebooks keep selectable text while the PDF is repackaged without rasterizing page content.

Include only the pages you need

Narrowing down page ranges shrinks large documents dramatically when you only need specific sections.

Review the page 1 preview

Check the preview at your chosen settings before downloading to ensure quality meets your needs.

Remove metadata when sharing

Stripping author and property fields helps protect privacy and trims extra data.

Keep your original file

Image compression discards image detail that cannot be recovered once saved.

Common questions about PDF compression

Clear answers about browser-based processing, compression settings, and output quality.

Is my PDF uploaded?

The compression code processes the PDF in your browser. This page does not upload the PDF to AllInOneTools servers for compression.

Why can't I select text in the compressed PDF?

That happens in Image mode: each page is rendered to a JPEG image, which can produce a much smaller file but removes the original text layer. Use Smart mode if you need text to remain selectable and searchable.

Will compressing reduce the quality of my PDF?

In Image mode, yes — the Compression Level and DPI control that trade-off. Basic keeps more image detail; Extreme uses the lowest JPEG quality setting for stronger size reduction at the cost of sharpness. Smart mode does not rasterize page content.

How much will my file size be reduced?

It depends on the mode and settings you pick. Image mode can achieve significant reductions on scan-heavy documents, but results vary based on the source file.

What do the compression levels do?

They set the JPEG quality used in Image mode. Basic keeps the most detail with a larger file, Recommended balances quality and size, High noticeably reduces quality for a smaller file, and Extreme uses the lowest JPEG quality setting to prioritize reduction.

What happens to my file after I'm done?

The compression process runs in your browser, and this tool does not send the PDF to AllInOneTools servers for processing. Your original file is not modified; the compressed PDF is created as a separate download.

Build notes

How the browser-based compression works

Because processing runs locally in your browser, I documented the client-side implementation covering pdf-lib structure repackaging and the canvas-to-JPEG pipeline.

Published on freeCodeCamp

How to Compress PDF Files in the Browser Using JavaScript

Covers the browser-side implementation behind this approach, including PDF handling, canvas rendering, JPEG conversion, and local file processing.

Read the write-up on freeCodeCamp →

Written by Bhavin Sheth · Founder, AllInOneTools