Compress PDF
Reduce PDF file size by a level or to a target such as 1 MB: duplicates are merged, images re-encoded and the rest recompressed.
Your files stay on this device. Nothing is uploaded. How to check
How to use Compress PDF
Key features of Compress PDF
Many PDFs embed the same logo, stamp or font again on every page. Identical images, fonts and colour profiles are stored once and every page points at that copy, which can remove most of a file with no change in quality.
JPEG, Flate and raw RGB or grey images, palette images and images with a transparency mask are decoded, downscaled to the level you chose and re-encoded as JPEG in place; a mask is kept as it is. CMYK, JPEG 2000 and fax-style black-and-white images are left alone and counted in the result.
Enter a size such as 1 MB or 200 KB and the tool searches its settings, from lossless down to images of 500 px at JPEG quality 35, for the mildest one whose result fits. That takes up to four passes over the file. If no setting is small enough, you get the smallest result and the reason.
Fonts and page content stored uncompressed or with weak compression are compressed again, and objects the document no longer uses are dropped. Both steps are lossless.
The rebuilt file is compared with the original. If it is not at least 1% smaller you get your original bytes back, and the message says what was tried and which part of the file takes the space.
The file is read, rewritten and saved by JavaScript in your browser. Nothing is sent to a server.
About Compress PDF
Compress PDF opens your file with pdf-lib and works through four steps. It merges streams that are byte-for-byte identical, so a logo embedded on every page is stored once. It re-encodes the images it can decode as JPEG at the chosen size and quality, keeping any transparency mask. Then it recompresses data that was stored uncompressed or weakly compressed, drops objects nothing refers to, and saves the document with object streams.
Text, fonts, vector graphics, links and form fields are not rasterised or redrawn, so the text stays searchable and selectable. A PDF that is mostly embedded fonts or plain text has little to take out and may come back unchanged; the result then says which part of the file takes the space.
When to use Compress PDF
A portfolio or brochure exported from a design program carries photos far larger than a printed page can show. Recommended caps each image at 1600 px and re-encodes it at JPEG quality 75. When a job portal or a client upload form states a limit, such as 2 MB, pick Target size and enter that limit; the tool uses the mildest setting that gets under it.
A stack of receipts photographed with a phone and saved as one PDF is a different case: every page is one large JPEG and nobody will print it. Pick Strong (1100 px, quality 55) for the smallest file that still reads on screen, then attach it to the expense claim.
A statement or form downloaded from a government or bank portal often repeats the same logo and fonts on every page. Even Lossless shrinks those, because the copies are merged and nothing on the page changes.
When a file comes back unchanged, the weight is somewhere this tool does not reach. If you only need a few pages, cut them out with Extract Pages or drop the rest with Delete Pages. If you need the images themselves rather than the PDF, Compress Images works on JPG, PNG and WEBP files directly.
Tips and troubleshooting
- "This PDF is encrypted" means the file has a password or print and copy restrictions, which pdf-lib will not rewrite. Remove the protection with Unlock PDF first.
- If the message says the file is already as small as it can be, read the rest of it: it lists what was tried and which part of the file is largest. Mostly images: try Strong, or a smaller size under Advanced options. Mostly images in formats this tool leaves as they are: no level helps, because those images are never re-encoded. Mostly fonts: embedded fonts cannot be made smaller here.
- Target size counts 1 MB as 1,000,000 bytes, the stricter of the two ways upload forms count, so a file made for a 2 MB limit passes either way. It runs up to four passes over the file, so it takes up to four times as long as a single level. When the target cannot be reached, the message gives the smallest size the tool could make and which part of the file takes the space.
- An image is replaced only when its new JPEG is smaller than the stream it came from, and it is written back as an 8-bit RGB JPEG. The greyscale option turns colour photos grey, which saves a little more.
- The download is named after your file with _compressed added, so report.pdf becomes report_compressed.pdf. Title, author and dates are kept; tick the metadata option under Advanced options to drop the XMP copy, page thumbnails and editing data.
- Any change to a file breaks a digital signature on it. Compress a signed PDF only if the signature does not need to verify afterwards.
- Preview Document opens the result in your browser's own PDF viewer inside a modal, because this page does not load pdf.js. Close it with the Esc key.
- Sending the file by email? How to compress a PDF for email explains which level to pick and what to try when the file is still too big.
- Uploading to a form with a limit such as 2 MB or 200 KB? How to compress a PDF to a specific size shows what Target size reached on a scan, a photo brochure and a text file.
How Compress PDF works in your browser
When you click Compress PDF, the page reads your file into memory and hands the bytes to pdf-lib, the only library this page loads. Every stream is hashed with SHA-256 together with its dictionary; streams with the same hash are merged and every reference in the document is pointed at the copy that stays. This repeats, so that images whose masks were merged can then merge too.
Images are checked for filter, colour space and masks. A JPEG is decoded with createImageBitmap, a Flate stream is inflated, palette images are expanded through their colour table, and the pixels are drawn onto a canvas no larger than the chosen size and exported as JPEG. The new stream replaces the old one only if it is smaller. Remaining uncompressed or Flate streams are compressed again and kept when smaller, unreachable objects are dropped, and the document is saved with object streams. Download File saves the result when it is at least 1% smaller than the original, or smaller at all when you asked for metadata to be removed and it was; otherwise it saves the original. Nothing is uploaded.
With Target size the same steps run up to four times. The settings go from lossless to images of 500 px at JPEG quality 35 in eight steps; each pass halves the range that is left, and the mildest setting whose result is at or under the target is kept. A file that is already under the target only gets the lossless pass.
Frequently asked questions
How much smaller will my PDF get?
It depends on what is inside it. Files that repeat an image or font on every page and files with large photos shrink the most; a PDF that is mostly text or embedded fonts has little to take out. The result always shows the real size before and after, and the tool never returns a larger file.
Will the text still be searchable after compression?
Yes. Text, fonts, vector graphics, links and form fields are left as they were. A font embedded twice may be merged into one copy, which changes nothing on the page.
Can I compress a PDF to a specific size, such as 1 MB or 200 KB?
Yes. Pick Target size, enter the size and choose MB or KB, then click Compress PDF. The tool searches eight settings, from lossless compression down to images of 500 px at JPEG quality 35, in up to four passes, and keeps the mildest result at or under the target. If even the strongest setting leaves the file over the target, you get the smallest result and the message says which part of the file takes the space.
Will compressing change how the PDF looks?
At the Recommended and Strong levels, only the images change: they are scaled down to at most 1600 or 1100 px and re-encoded as JPEG, so fine detail in photos softens, more so at Strong. Text, lines and vector drawings are not touched. At Lossless nothing visible changes.
Why does my scanned PDF not get smaller?
Many scanners store black-and-white pages with CCITT or JBIG2 compression and colour pages as JPX, and this tool leaves those encodings alone. Scans stored as JPEG do shrink unless they were already saved small; the result lists how many images were re-encoded and how many were left as they were.
Does it keep bookmarks, links and form fields?
Yes. Bookmarks, links, form fields, annotations and the document properties come through as they were. Only the XMP metadata, page thumbnails and editing data can be removed, and only when you tick that option.
Last reviewed