DDanfio

Compress PDF

Most "compress PDF" pages ask you to upload the document - often the very contract, scan or invoice you are trying to keep private - and then hand back something smaller, usually by rasterising it. This one does the work inside the browser tab: the file is read with the browser file API, the pictures inside it are re-encoded on your own device, and the smaller PDF arrives as a download.

Drag & drop a file here, or .

Everything is processed in your browser - nothing is uploaded.

    One PDF up to 25 MB. It is read in this browser tab and never uploaded; the pictures are re-encoded on your own device.

    Lower quality means smaller pictures. 70% is invisible on most scans and screenshots.

    Downscaling is where most of the saving comes from. A picture that is already narrower than the cap keeps its own size.

    Leave blank to name the file after the one you drop in.

    Only used for the plan below, before a file is chosen. The real job reads the document itself.

    Results update as you type. Nothing leaves your device.

    Plan for a PDF with 6 images

    1600 px wide, quality 70%

    Every JPEG picture is decoded, scaled to 1600 px wide and re-encoded at 70%, then written back into the same spot in the document. Text, fonts, links and page sizes are copied through untouched, and your-file-compressed.pdf arrives as a download on your device.

    Images to check
    6
    Width cap
    1600 px wide
    JPEG quality
    70%
    Output name
    your-file-compressed.pdf
    Only pictures change. Text, fonts, links, form fields and page sizes are copied through untouched, so the words in the output are still selectable, searchable and copyable - nothing is rasterised into an image.
    Pictures that are not JPEGs (PNG or Flate, fax, JPEG 2000), pictures with a transparency mask, CMYK and 1-bit images, and pictures carrying an EXIF rotation flag are left alone and listed in the result instead of being guessed at.
    How much this saves depends entirely on the file. Measured on a four-page, photo-heavy document, 1073 KB came out at 89 KB with a 1000 px cap at quality 60%; a PDF that is mostly text saves nothing at all, because there is nothing inside it that can be re-encoded. The real numbers appear here as soon as a PDF is added.
    Downscaling cannot be undone. Keep the original file if you may need the full detail later: the pictures inside the output really are smaller.
    A PDF that needs a password is refused rather than guessed at - open it with the password once, save a copy without it, then compress that. Document metadata, passwords and permissions are never touched by this tool.

    It is also honest about where the saving comes from. Re-saving a PDF without touching anything inside it saves nothing worth having, so this tool does one specific thing: it finds the JPEG pictures already stored in the document, decodes each one, scales it to the width you asked for, re-encodes it at the quality you chose and writes the result back into the same place in the file. The text, fonts, links and page sizes are copied through untouched. If the finished file would not be smaller than the one you dropped in, you get your own file back, byte for byte.

    How this compress pdf works

    What can actually be made smaller inside a PDF

    A PDF is a container: text, fonts, vectors, bookmarks and pictures, each stored as its own object. Writing the same objects out again is not compression, and it is measurable - re-saving a four-page text document changed its size by 0.0%, and stripping its metadata changed it by 0.4%. Turning object streams off, which is what some quick "compression" actually does, grew that same file by 92%.

    Rasterising the pages is the other common trick, and it is why uploaded files come back blurry and unsearchable: a single letter-sized page at 150 dpi costs around 227 KB as a picture, so a text-heavy document gets bigger while its words stop being words. This tool does not do that. The one lever that genuinely pays is the pictures that are already inside the document, because they are what makes a PDF big in the first place.

    How each picture is re-encoded

    Every image object whose filter is exactly DCTDecode - a JPEG - is a candidate. The bytes are handed to the browser's own JPEG decoder, drawn onto a canvas at the target pixel size (with smoothing on, so a downscale is resampled rather than sampled), and encoded again as a JPEG at the quality you selected. The new bytes replace the old ones inside the same image object, so nothing else in the document has to be renumbered or re-linked.

    Three rules keep the output from being a disappointment. A re-encoded picture is only kept when it comes back at least 5% and 1 KB smaller, so quality is never traded for a handful of bytes. The document is then written out twice, once with object streams and once without, and the smaller encoding wins - the cross-reference data of a file that was already packed can grow when it is rewritten, and you should not pay for that. And if the finished file is not smaller than the original, you are handed the original: the tool will not rewrite your document to no purpose and call it compression.

    The quality slider is the JPEG encoder's quality, not a claim about how the page looks. Canvas encoders differ, so 70% here is not the same number as 70% in a photo editor; the honest way to use it is to try one setting, look at the result, and step down if the pictures still look soft enough for you.

    What is deliberately left alone, and why

    Pictures stored losslessly (Flate, PNG, CCITT fax, JPEG 2000) would have to be decoded into a raw pixel buffer here, and a buffer read the wrong way - the wrong colour space, a missing predictor, a 1-bit image - shows up as a garbled picture in your document. The same goes for CMYK and ICCBased images, whose colours browsers disagree about, and for stencil and soft masks, which have to stay the size of the picture they belong to. Rather than guess, the tool skips them and tells you exactly which ones and why.

    Pictures carrying an EXIF rotation flag are skipped too. The stored pixels there are the un-rotated ones and the flag tells the viewer to turn them, and browsers disagree about applying that flag while decoding - getting it wrong would lay the picture on its side in your document, which is far worse than a file that stayed large.

    Nothing else in the document is touched. Document metadata, bookmarks, links, form fields and permissions are copied through exactly as they were, which is also why a PDF that needs a password is refused instead of guessed at: this tool has no way to ask for one.

    Worked examples

    Each example below was run through the calculator on this page when the site was built, so the numbers match what you see when you enter the same inputs.

    A scanned contract, 1600 px pictures at balanced quality

    JPEG quality
    Balanced (recommended for most documents)
    Pixel width cap
    Up to 1600 px wide (recommended for scans)
    Output file name
    contract
    Preview: pictures inside the PDF
    6 images

    Plan for a PDF with 6 images

    1600 px wide, quality 70%

    Every JPEG picture is decoded, scaled to 1600 px wide and re-encoded at 70%, then written back into the same spot in the document. Text, fonts, links and page sizes are copied through untouched, and contract-compressed.pdf arrives as a download on your device.

    Images to check
    6
    Width cap
    1600 px wide
    JPEG quality
    70%
    Output name
    contract-compressed.pdf

    Six pages of scans, each stored as one big JPEG. At a 1600 px cap and 70% quality the pictures come back readable on screen and in print, and contract-compressed.pdf holds the same six pages with the same selectable text.

    A photo-heavy report aimed at an email limit

    JPEG quality
    Small - fine for reading on screen
    Pixel width cap
    Up to 1200 px wide (screen reading)
    Output file name
    site-report
    Preview: pictures inside the PDF
    12 images

    Plan for a PDF with 12 images

    1200 px wide, quality 55%

    Every JPEG picture is decoded, scaled to 1200 px wide and re-encoded at 55%, then written back into the same spot in the document. Text, fonts, links and page sizes are copied through untouched, and site-report-compressed.pdf arrives as a download on your device.

    Images to check
    12
    Width cap
    1200 px wide
    JPEG quality
    55%
    Output name
    site-report-compressed.pdf

    Twelve photographs at 1200 px and 55% quality is the setting to try when a 10 MB limit is in the way: measured on a four-page document whose four 1600x1200 photographs were stored at 95% quality, the file went from 1073 KB to 89 KB with a similar cap and quality.

    Keeping the original pixel size and only re-encoding

    JPEG quality
    High - barely visible on screen, small saving
    Pixel width cap
    Keep the pixel size (quality only)
    Output file name
    archive
    Preview: pictures inside the PDF
    4 images

    Plan for a PDF with 4 images

    original pixels, quality 85%

    Every JPEG picture is decoded, scaled to original pixels and re-encoded at 85%, then written back into the same spot in the document. Text, fonts, links and page sizes are copied through untouched, and archive-compressed.pdf arrives as a download on your device.

    Images to check
    4
    Width cap
    original pixels
    JPEG quality
    85%
    Output name
    archive-compressed.pdf

    With the width cap off nothing is downscaled: only the JPEG data is re-encoded at 85%. That is the gentlest setting, and on a document whose pictures are already stored efficiently it may save nothing at all - in which case the original file is handed straight back.

    Frequently asked questions

    Is this PDF compressor free, with no account and no watermark?

    Yes. There is no sign-up, no email step, no daily limit and nothing added by danfio: the output contains your document and nothing else. The job runs in your browser, so there is no server cost to recover and no upload endpoint behind the page.

    How much smaller will my PDF get?

    It depends entirely on what is inside it. A document built from photographs or scans is where the saving lives: measured on a four-page file whose four 1600x1200 photographs were stored at 95% quality, 1073 KB came out at 89 KB with a 1000 px cap at 60% quality - about 92% smaller. A PDF that is mostly text saves nothing at all, because re-saving the same objects is not compression. The result panel always shows the real numbers for the file you actually dropped in, including when that number is zero.

    Why did my file come back the same size?

    Because nothing inside it could be made smaller. The result panel lists every picture it left alone and the reason: they may already be stored efficiently, they may not be JPEGs at all (Flate, PNG or fax compression), or they may be one of the shapes this tool refuses to guess about, such as CMYK images or pictures with soft masks. When that happens you are handed your own file back, byte for byte, rather than a rewritten copy that only pretends to be compressed - and the panel says so instead of showing a made-up percentage.

    Does compressing the PDF hurt the text or make it unsearchable?

    No. Text, fonts, vectors, links and page sizes are copied through as they were; only the picture streams are replaced. That is the opposite of the usual upload-and-rasterise approach, where every page comes back as an image and the words stop being words. The trade you are making is inside the photographs: downscaling and re-encoding throws away detail that cannot be recovered, so keep the original if you may need it at full size later.

    Which pictures cannot be compressed here?

    Anything that is not a plain 8-bit JPEG stored in DeviceRGB or DeviceGray: Flate and PNG images, CCITT fax and JPEG 2000, CMYK and ICCBased images, stencil and soft masks, images with a Decode array or DecodeParms, and pictures carrying an EXIF rotation flag. Each one is reported with its own reason in the result. The rule behind that list is simple - if shrinking a picture means this code interpreting pixel data that a browser might read differently, it is left alone rather than risk a garbled picture in your document.

    Is my PDF uploaded to compress it?

    No. The file is read with the browser file API, the pictures are decoded and re-encoded on a canvas in the tab you are looking at, and the download is a Blob URL that exists only there. Watching the network panel in your developer tools while the job runs shows no request carrying the file, and the tool still works with the network disconnected.

    Can it remove a password or permissions from a PDF?

    Not here. A PDF that needs a password is refused with a message rather than guessed at, because this tool has no way to ask for the password and no server to hold a key. Open the file with its password once and save a copy with the protection removed, then compress that copy. Document metadata, permissions and form data are never touched, which is why a compressed file still opens in every reader exactly as before.

    What are the limits, and what happens on a very large file?

    One PDF per job, up to 25 MB. Everything happens in memory in your tab, so a large file costs time rather than bandwidth: the pictures are decoded one at a time, and a 25 MB document of scans is normally a few seconds on a laptop. If the browser cannot provide the image decoder this tool needs, the job is refused with a message naming the browsers that work, rather than quietly producing an unchanged file.

    Assumptions and sources

    • Processing: pdf-lib (MIT licensed) reads and writes the document, and the browser's own image decoder and canvas encoder re-encode each JPEG. Both run inside your tab; the file itself is never sent anywhere.
    • Measured rather than assumed: re-saving a four-page text PDF changed its size by 0.0%, stripping its metadata changed it by 0.4%, and writing it without object streams grew it by 92% - which is why this tool re-encodes pictures instead of promising lossless compression. Rasterising a page at 150 dpi costs about 227 KB per page, so that is not offered either.
    • Photograph example: 1600x1200 at quality 95 (1071 KB) became 1000x750 at quality 60 (88 KB), and a four-page document holding four such pictures went from 1073 KB to 89 KB, with the text still selectable.
    • Refusal rules: only image objects whose filter is exactly DCTDecode, with 8 bits per component, a DeviceRGB or DeviceGray colour space, no Decode array, no DecodeParms, no soft or stencil mask use and no EXIF rotation flag. A re-encode is kept only when it is at least 5% and 1 KB smaller, and the finished file is only offered when it is smaller than the input.
    • Privacy: no file, file name, page content or picture is sent to danfio.com. There is no upload endpoint behind this tool, and the download is a Blob held in your own tab.

    Last reviewed 2026-09-14. This page is an estimate tool, not financial, tax or legal advice.Read the full disclaimer.