pdf tool

Compress PDF

Most compressors give you a preset and hope. This one measures the file first, shows you which part of it is actually big, then picks the method that part responds to. You see the same page before and after at the setting you chose, and if rebuilding would make the file bigger, it says so and gives you nothing.

Runs on your device. Nothing is uploaded.

Loading the tool…

How to use it

  1. 1

    Drop the PDF

    It is measured on the spot: how many bytes are pictures, embedded fonts, page instructions and structure.

  2. 2

    Read the verdict

    The bar and the note underneath say what is big and which method that responds to. The method is chosen for you from the evidence.

  3. 3

    Check the page

    The same page appears before and after at the chosen quality, cropped to the busiest part so you are judging real detail, not a margin.

  4. 4

    Compress and download

    The predicted size becomes a real one. If the result is not smaller, nothing is downloaded and the page tells you to keep the original.

Where a PDF’s size actually goes

There are three regimes and they need three different answers. A scan is 99 to 100 percent pictures, and image work is enormously effective there: the same eight pages went from 90.6 MB as raw raster to 3.4 MB as JPEG, a factor of 26. A text document generated by an app is a different animal: embedded font subsets were 70 to 78 percent of every business PDF measured, content streams 1 to 8 percent, and pictures zero. Downsampling images on that file does literally nothing. A large structured document is a third case, where 71 percent of the bytes were object dictionaries and a cross reference table with 127,000 entries.

What a browser can and cannot do

Rewriting a PDF with object streams and a cross reference stream, which is what the Repack method does, took 12 to 16 percent off every text document measured and nothing at all off a scan. Copying the pages into an empty document goes further because it walks only the live object graph, dropping unused objects and every earlier saved revision; six trivial incremental edits had inflated one file by 82 percent, and a rebuild recovered all of it. Re-encoding embedded JPEGs where they sit took 41 percent off a 3.6 MB scan while leaving the text selectable. Font subsetting, the one lever that would help a text document most, needs a font engine no browser ships.

Why flattening every page is usually the wrong move

Turning each page into a photograph is what most simple compressors do, and on a scan it is reasonable. On a text document it is a disaster. Sixteen real text pages weighing 150 KB came out at 4,089 KB when rasterised at 150 PPI, a 27 fold increase, and the text stopped being selectable, searchable and readable by a screen reader. That is why this tool only reaches for it when the pages are already dominated by pictures, and warns loudly when you pick it yourself.

Never handing back a bigger file

Every compressor claims up to 99 percent. That number is real, but only for an uncompressed raster scan, and the same settings applied to an already tight file will inflate it. Ghostscript’s own printer and prepress presets do not downsample at all and made a 200 PPI scan 0.1 percent larger. Here, each re-encoded picture is only kept when it came out smaller than the original, and the finished file is compared against the one you dropped in. If it lost, you get a message rather than a download.

Limits

  • No browser library can re-subset an embedded font. On a text document where fonts are 70 percent of the file, that is the biggest lever and it is out of reach here. Ghostscript on a desktop gets about 30 percent on those files; this tool gets the 10 to 16 percent that comes from repacking the structure.
  • An encrypted PDF cannot be rebuilt. pdf-lib will not decrypt, and forcing it produces a file that no reader can open, so the tool refuses instead.
  • Only JPEG pictures can be swapped in place. Images stored as PNG style Flate, JPEG 2000, CCITT fax or JBIG2 are left alone, because re-encoding a one bit scan as JPEG can make it eight times larger.
  • A very large file takes a long time to parse and the tab will be unresponsive while it does. Files over about 8 MB only run the structural preview when you press the button.
  • Rebuild from the pages leaves bookmarks, attachments, the document title and the author behind. Repack keeps all of them.

What it does not do

  • It does not run OCR, and it does not add a text layer to a scan.
  • It does not target a size you type in. It reports what each method actually achieves and lets you choose.
  • It does not merge, split or reorder anything. Those are separate tools.

Questions people ask

Why did it barely shrink my file?

Look at the bar. If pictures are a thin sliver and embedded fonts are most of the width, there is very little a browser can take out. Fonts only shrink by being re-subset to the letters you actually used, and that needs a font engine no browser has. What you can get is the 10 to 16 percent that comes from repacking the structure.

Does the text stay selectable?

With Repack, Rebuild and Shrink the pictures, yes. Those three leave every mark on the page exactly where it was and only change how the file is packed or how its photographs are encoded. Flatten every page is the exception: it replaces each page with a picture, and after that there is no text in the file at all.

What is the difference between Repack and Rebuild?

Repack rewrites the same objects more compactly and keeps everything, including bookmarks, attachments, the title and the author. Rebuild copies the pages into an empty document, which also drops old saved revisions and anything no page points at. It usually wins on a file that has been edited and re-signed several times, but you lose the bookmarks.

Why does it say the result would be bigger?

Because it measured it. That happens when the file is already tightly packed, or when its pictures are already at or below the quality you asked for. Re-encoding a JPEG always loses a little detail, and past a point it stops saving anything and starts costing. Keeping the original is the right answer there.

It will not open my file.

Almost certainly encryption. A surprising number of PDFs carry permissions encryption with an empty password, which readers open silently but a rewriter cannot touch. Open it in a viewer and save an unprotected copy. Forcing the rewrite would produce a file no reader could open, so the tool declines instead.

Which quality should I pick?

Email at 150 PPI is the sensible default for anything sent as an attachment. Print at 200 PPI keeps enough detail for a desk printer. Screen at 110 PPI is for something only ever read on a display. Resolution matters far more than the quality number: halving the resolution is roughly a four fold saving.

Does grayscale make it much smaller?

Less than people expect, which is why it is not offered. On a text scan, converting to grayscale saved about 2 percent, because JPEG already stores colour at reduced resolution. On photographs it is 14 to 16 percent. It is a look, not a compression strategy, and it throws away information you cannot get back.

Rebuild this as a proper document

Take what you made here into documents.

Create a document with OneCraft

Related tools

Built with pdf.js (Apache-2.0), pdf-lib (MIT).

Sources

Written and checked by the OneCraft team. Last checked .