Runs in your browser with pdf.js and pdf-lib

Compress PDF Files Online — smaller files, text still selectable

Shrink the pictures inside a PDF while text, links and bookmarks stay as they are, or flatten every page for the smallest file. Need it under 100 KB or 200 KB for a form? Pick a target size and the tool keeps the sharpest version that fits.

See how it works
  • PDF files aren't uploaded to our server
  • Text stays selectable
  • Before and after, page by page
  • Free, no account

Make your PDF smaller, and check it before you send it

Add a PDF, pick how far to go, then compare every page with the original.

Works on one PDF at a time. The original file is never changed.

Drop your PDF here

or browse — one PDF, any number of pages

Page 1

How compression actually works

In most PDFs, the pictures are the weight

Text and fonts take little space. Photos, scans and screenshots saved at full camera size are what make a PDF too big to email.

Two ways to make it smaller

Keep text finds each picture in the file, scales it down to what the page needs and saves it again as a lighter JPEG. Everything else, from text and fonts to links, bookmarks and form fields, is left exactly as it was.

Flatten to images draws each page as one picture at the resolution you choose. It can beat Keep text on scans, but the text becomes part of the picture. pdf.js and pdf-lib do the work in your browser tab, so your PDF isn't uploaded to our server.

What you see before and after

What's inside

As soon as you add a file, the tool counts its pictures and tells you how much of the size they make up, so you know whether compressing will help.

Three strengths

Light, Recommended and Strong, each with its resolution and JPEG quality spelled out.

Before and after

Switch every page between Original and Compressed, or open one full size at 200% to check small print.

An honest result

If a setting makes the file bigger, the tool says so and suggests keeping your original.

How to compress a PDF in four steps

Start with Keep text at Recommended. Only go further if the file is still too big.

Add your PDF

Drop a PDF onto the upload area, or click Select PDF. The bar above the settings shows how much of the file is pictures.

A file that's mostly text won't shrink much, whatever the tool.

Choose how and how much

  • Keep text for documents people will read, search or sign.
  • Flatten to images for scans that only need to be looked at.
  • Light, Recommended or Strong sets resolution and quality.

Compress and compare

Click Compress PDF. When it's done, switch the pages to Compressed, or open one full size and flip between Original and Compressed.

Cancel stops the work at any point.

Check the size and download

The result shows the old and new size and the saving. Rename the file if you like, and download it.

  • Exact sizes
  • Page-by-page comparison
  • Original untouched

What compressing a scan can do

One scanned report, before and after.

Original scan 6.28 MB
A scanned PDF report before compression, 6.28 MB
Too big for many email and upload limits.
Compressed
After compressing 318.59 KB
The same scanned report after compression, 318.59 KB
Readable on screen, small enough to attach.

Which settings to use for your file

A starting point for common files. Compare before you download either way.

FileWhat mattersSettings to try
Report or brochure with photosPhotos look fine on screen; text stays searchable.Keep text, Recommended.
Contract or form to signText, form fields and links must keep working.Keep text, Light or Recommended. Never flatten.
Form upload with a size limit (100 KB, 200 KB)The file must be under the limit and still readable.Target size with the portal's limit; for a scan, Flatten to images if Keep text can't reach it.
Scanned pages for an email limitReadable on screen, as small as possible.Flatten to images, Recommended; Strong if still too big.
Scan that will be printedSmall print must stay sharp on paper.Flatten to images, Light, or Keep text, Light.
Resume or CV for a job portalApplicant tracking systems need to read the text.Keep text only.
Slides exported to PDFLarge images on every slide.Keep text, Recommended or Strong.
Text-only documentAlready small; few pictures to shrink.Keep text with document details removed; expect a small saving.

Settings in numbers

What each strength actually does

Resolution is the most detail a page needs; JPEG quality decides how much fine detail each picture keeps.

Light

Keep text: pictures up to 200 dpi, quality 85%. Flatten: pages at 150 dpi, quality 85%. Good for printing.

Recommended

Keep text: pictures up to 150 dpi, quality 72%. Flatten: pages at 120 dpi, quality 70%. Sharp on screen.

Strong

Keep text: pictures up to 100 dpi, quality 55%. Flatten: pages at 90 dpi, quality 55%. Smallest; check small print.

What's never touched

A picture is only replaced if the new version is clearly smaller. CMYK print images, transparency masks and tiny icons are left as they are, and page sizes never change.

When the result isn't what you expected

Identify the problem, then use the matching fix.

Symptom
Why it happens
Fix

Hardly any saving

The file is mostly text and fonts, or its pictures are already compressed. The bar at the top shows this before you start.

Try Strong. For a scan, try Flatten to images. If neither helps, the file is already compact.

The file got bigger

Flattening a text page turns crisp vector text into a picture, which can weigh more.

Use Keep text instead, or keep your original. The result tells you when this happens.

Small print looks blurry

The resolution is too low for the smallest text in a scan.

Open the page full size at 200%, then try Light.

Text can't be selected

Flatten to images was used, so each page is now one picture.

Compress the original again with Keep text.

It takes a while on a big file

Every picture or page is decoded and saved again on your own device.

Keep the tab open; the progress bar counts pictures or pages. Close other tabs if memory is low.

Still too big for the limit

Some pages may not be needed at all.

Remove pages with Organize PDF or send parts with Split PDF, then compress again.

A password-protected PDF won't open

Encrypted PDFs can't be rewritten by the in-browser PDF libraries.

Remove the password with Unlock PDF, then add the unlocked copy.

Get the size you need on the first try

A working order that avoids a second round.

Read the bar first

If pictures are only a small share of the file, no setting will save much. Don't flatten a text document hoping it will.

Start with Recommended

Move to Strong only if the file is still over your limit, and compare small print when you do.

Keep text for anything official

Contracts, forms and CVs need selectable text. Flatten only scans and photos.

Check the busiest page at 200%

Open the page with the smallest text or the most detailed photo full size, and flip between Original and Compressed.

Compress last

Merge, organize and number pages first. Compressing is the final step before sending.

Keep the original

Detail removed from a picture can't be brought back. Keep the full-quality file for printing or archiving.

Common questions about compressing PDFs

If something's not covered here, the troubleshooting section above likely has it.

Does this tool upload my PDF to a server?

No. The compression runs in your browser with pdf.js and pdf-lib. Your PDF is read on your device and is not uploaded to the AllInOneTools server.

Will my text still be selectable after compressing?

Yes, with Keep text. It only re-saves the pictures inside the PDF, so text, fonts, links, bookmarks and form fields stay exactly as they were. Flatten to images turns each page into one picture, so text can no longer be selected or searched.

How much smaller will my PDF get?

It depends on how much of the file is pictures. The bar shown after you add a file tells you: when pictures are most of the file, Keep text at Recommended often saves a lot; a file that is mostly text will only shrink a little.

Which setting should I choose?

Start with Keep text at Recommended. If the file is still too big, try Strong. If a portal sets a limit such as 200 KB, choose Target size instead. For scanned pages that only need to be read on screen, Flatten to images at Recommended is usually the smallest.

Can I compress a PDF to 100 KB or 200 KB?

Yes. Choose Target size, then 100 KB, 200 KB, 500 KB, 1 MB, or type your own size. The tool tries up to six quality levels and keeps the sharpest file under the limit, counting 1 KB as 1,000 bytes so it also fits portals that count 1,024. A PDF that is mostly text may not get that small with Keep text; the result then shows the smallest size it could make, and Flatten to images usually gets a scan under the limit.

Why did my file get bigger?

Flattening a page with sharp vector text turns it into a picture, which can weigh more than the original text. The result tells you when the file is not smaller, so you can keep your original or use Keep text instead.

Can I check the quality before downloading?

Yes. After compressing, the pages switch to the compressed version, and the Original and Compressed buttons let you flip between them. Open any page full size and zoom to 200% to check small print.

Does compressing change my original file?

No. The tool creates a new, separate PDF for you to download. Your original file is not changed, so keep it if you may need full quality later.

Build notes

The write-up on compressing PDFs in the browser

Because compression runs client-side, I wrote a tutorial on building a browser-based PDF compressor with JavaScript.

Published on freeCodeCamp

How to Compress PDF Files in the Browser Using JavaScript

A step-by-step tutorial on compressing PDFs client-side with JavaScript.

Read the write-up on freeCodeCamp

Written by Bhavin J. Sheth, founder of AllInOneTools