PDF

How to compress a PDF to 5MB, with seven real test results

A 5 MB limit is generous for scans, so the real questions are different: is your file already under the line, which way the portal counts a megabyte, and what you lose when pages are rasterized. We tested seven scans, from one page to twenty four.

Updated ยท 11 min read

Featured image: How to compress a PDF to 5MB, with seven real test results, with a real screenshot of the Compress PDF tool tool on Dokurapi
Inside the frame: a real screenshot of the Dokurapi tool. All processing runs in the browser, nothing is uploaded.

To compress a PDF to 5MB, open Dokurapi's free Compress PDF tool, choose your file, type 5000 in the Custom target (KB) box, press Compress PDF, and read the Output line before you download. The tool aims 6% under the number you type, so a 5000 KB target means a file of at most 4,700,000 bytes. If your PDF is already under that line, the tool tells you to use the original instead. Everything happens in your browser tab, so the document is not uploaded anywhere.

5 MB is a roomy limit for scanned documents. In our tests a five page scan of 7.83 MB came out at 612,872 bytes, a twelve page bundle of 18.72 MB at 1,452,321 bytes, and even a twenty four page bundle of 37.53 MB fitted at 2,934,776 bytes, all on the tool's sharpest setting. Below you will find the steps, why a 4.69 MB file and a 4.71 MB file get different treatment, the full results table, what rasterizing costs you, and what to do when a file must keep its text. For tighter limits see our guides to 2 MB, 1 MB and 500 KB.

Steps to compress a PDF to 5MB

You need a browser and the PDF, nothing else. No account, no app, and no watermark is added. The tool writes a new file and leaves the one you picked as it was.

  1. Check the size first. Our PDF size checker shows the exact bytes and the page count. If the file is under 4.7 MB, you may not need to compress it at all.
  2. Open Compress PDF and choose one file. The preset list stops at 2 MB, so 5 MB goes in the Custom target box.
  3. Type 5000 in Custom target (KB). The tool counts 1 KB as 1,000 bytes, so 5000 means 5,000,000 bytes, and the safe target becomes 4,700,000 bytes.
  4. Press Compress PDF. The status line counts up to 12 attempts, but for a 5 MB target the first, sharpest attempt usually fits.
  5. Read the Output line. It shows the size and the exact bytes, for example 2.93 MB (2,934,776 B).
  6. Download and open the file. Zoom into small print and stamps before you upload it anywhere.

The whole run took between 1.4 and 7.2 seconds in our tests on a laptop, depending on the page count. On a phone it takes longer, and our guide to compressing a PDF on a phone covers that case.

Dokurapi's Compress PDF tool with 5000 typed in the custom target box, showing a 24-page scan of 37.53 MB that became 2.93 MB (2,934,776 bytes)
Our 24 page bundle in the tool with 5000 typed in Custom target (KB). The safe target was reached at 2,934,776 bytes on the first and sharpest attempt, and the status line warns that the pages were rasterized.

Ready to try it? The tool is free and runs in your browser.

Open the Compress PDF tool

When the file is already under 5MB

Before the tool renders anything, it compares your file with the safe target. If the PDF is at or under 4,700,000 bytes, it stops and says the file does not need compressing. This is deliberate. Compressing rasterizes every page, which removes selectable text, links, form fields and digital signatures, so the tool will not do it when there is nothing to gain.

Our two three page scans show how close that line can be. The English copy weighed 4,693,486 bytes, just under the line, and was kept as it was. The Indonesian copy of the same layout weighed 4,712,343 bytes, only 12,343 bytes over, and went through the compressor, coming out at 373,006 bytes. Same kind of document, almost the same size, completely different outcome.

Number line from 4.6 to 5.3 million bytes with the 4.7 MB safe line, 5,000,000 bytes and 5,242,880 bytes marked, and two three-page scans on either side of the safe line: 4,693,486 bytes kept as it is and 4,712,343 bytes compressed to 373,006 bytes
Two three page scans on either side of the 4.7 MB safe line. The file under the line is kept as it is, the file 12,343 bytes over is compressed. Drawing: Dokurapi.
Dokurapi's Compress PDF tool with 5000 in the custom target box and a 4.69 MB three-page scan selected, showing the message that the PDF is already under the target and the original should be used
The 4.69 MB scan in the tool. Instead of compressing, the tool reports that the file is already under the target and tells you to use the original.

5MB as 5,000,000 or 5,242,880 bytes

A megabyte can mean two numbers. In the SI system used by NIST, mega means one million, so 5 MB is 5,000,000 bytes. Some software counts in powers of two, where 1 MiB is 1,048,576 bytes and 5 MiB is 5,242,880 bytes, about 4.9% more. A portal that says "5 MB" may be using either, and most do not say which.

Typing 5000 in Dokurapi assumes the stricter reading, and the 6% margin on top brings the safe target down to 4,700,000 bytes. A file made this way passes both readings with room to spare. If you have a file that sits between 4.7 and 5 MB and you are sure the portal counts in MiB, you can try the original first, but keeping the margin costs very little on a 5 MB limit.

How the limit is readBytesOur 4.69 MB scanOur 4.71 MB scan
Dokurapi safe target (5000 minus 6%)4,700,000Under, kept as isOver, compressed
5 MB, decimal (SI)5,000,000UnderUnder
5 MiB, binary5,242,880UnderUnder

The table also shows why the 4.71 MB scan was compressed although it is technically under 5 MB: the tool keeps its safety margin on every target. For more on reading size labels see our guide to checking file size before upload.

Our 5MB test results

We used seven synthetic scans with no personal data: a one page letter, a two page form, a three page document, and bundles of five, eight, twelve and twenty four pages. They were made as image scans, the kind a phone scanner app or office copier produces, which is where most oversized PDFs come from. Four files were run through the tool with 5000 typed as the target. The one and two page files are well under the 4.7 MB safe line, so the tool keeps them as they are, and the eight page result is the first attempt size from the same raster code path as the tool.

FileOriginalOutputAttempt usedFits 5 MB
1 page letter1.50 MBunder target, original keptnoneYes
2 page form3.07 MBunder target, original keptnoneYes
3 page document4.69 MB (4,693,486 B)original keptnoneYes
5 page bundle7.83 MB612,872 B1 of 12Yes
8 page bundle12.48 MBabout 968 KB (attempt 1 size)1 of 12Yes
12 page bundle18.72 MB1,452,321 B1 of 12Yes
24 page bundle37.53 MB2,934,776 B1 of 12Yes

Every file fitted on attempt 1, the sharpest of the twelve, which renders an A4 page about 714 pixels wide and saves it as JPEG at quality 78%. That works out to roughly 120 KB per scanned page. At that rate a scan of about 38 pages would still fit under the safe line on the sharpest setting, and the tool's smaller attempts would carry far more pages beyond that, but this is an estimate from our averages, not a test result.

Paired bars for seven scans against the 4,700,000-byte safe line: the dashed original bars range from 1.50 to 37.53 MB, the 1, 2 and 3-page files are already under the line, and every compressed bar is between about 0.61 and 2.93 MB
Originals (dashed) and results (green) for seven scans. The one, two and three page files were already under the line and kept as they were; every other file dropped far below the 4.7 MB line on the sharpest attempt. Drawing: Dokurapi.

What a 5MB result looks like, and what you lose

Because the first attempt fits, a 5 MB target gives you the best quality this tool produces: 714 pixel wide pages at JPEG quality 78%. For typed text, form boxes and stamps that is easy to read on screen and fine when printed small. Hairline signatures and very small print, such as the footnotes on a certificate, look softer than in the original scan.

The bigger cost is not sharpness but structure. Rasterizing turns each page into a single picture, so you can no longer select or search the text, links stop working, form fields are flattened, and a digital signature is removed. The tool says so in the status line every time. For a scan, that changes nothing, because a scan is already a picture. For a PDF exported from Word or a signed contract, it changes a lot.

That is why the tool refuses to touch a file already under the target, and why you should look at the type of PDF before compressing. Our guide to compressing a PDF without losing quality covers files that are mostly text.

When the PDF must keep its text or signature

Some portals check that a PDF has selectable text, or a contract must keep its digital signature. In those cases do not rasterize. Reduce the content instead.

Decision flow for a 5 MB limit: if the PDF is under 4.7 MB upload the original; if not, ask whether the portal needs selectable text or a signature; if not, compress with target 5000; if yes, split the file or remove pages first
Which way to go with a 5 MB limit. Rasterizing is only the right answer when the portal does not need the text layer. Drawing: Dokurapi.
  • Remove pages the portal did not ask for. Blank backs of scans and cover sheets add weight. Our guide to deleting PDF pages shows how.
  • Split the file. If the portal accepts several uploads, split the PDF into parts that each stay under the limit.
  • Re-export from the source. A Word or spreadsheet file exported again to PDF is usually far smaller than a scan of the same pages.
  • Rescan at a lower resolution. Many scanner apps default to very high settings; 150 to 200 dpi is enough for most forms.
  • Sign last. If a document needs a signature, compress or assemble it first, then sign the final version with our sign PDF tool.

If several separate scans need to become one file under 5 MB, combine them first with Merge PDF and check the size before compressing. Our guide to merging PDFs for submissions covers page order and naming.

Common mistakes with a 5MB limit

  • Compressing a file that already fits. You lose the text layer for nothing. Check the size first.
  • Typing 5120 instead of 5000. It works if the portal counts in MiB, but fails if it counts in decimal megabytes. 5000 is the safer number.
  • Uploading a 4.9 MB original to a strict portal. It is under 5,000,000 bytes, but some portals reject files close to the limit after adding their own overhead. A small margin avoids that.
  • Merging everything into one giant file. If the form has separate upload slots, use them instead of forcing one file under the limit.
  • Not opening the result. Always check that every page is there and readable before you submit.

For the opposite problem, a portal that sets a much smaller cap, see compressing a PDF to a specific size, and when a file stays too big after compressing, see what to do when a compressed file is still too big.

Frequently asked questions

How do I compress a PDF to 5MB for free?
Open the Dokurapi Compress PDF tool, choose the PDF, type 5000 in the Custom target (KB) box, press Compress PDF, and download the result. It is free, needs no account, and the file is processed in your browser.
Why does the tool say my PDF does not need compressing?
Because the file is already at or under the safe target of 4,700,000 bytes. Compressing would rasterize the pages and remove text, links and signatures without any benefit, so the tool tells you to use the original.
Should I type 5000 or 5120 for a 5MB limit?
Type 5000. It covers both readings of 5 MB: 5,000,000 bytes in decimal and 5,242,880 bytes in binary. 5120 only works if the portal counts in binary units.
Why did a 4.71 MB file get compressed if it is under 5 MB?
The tool always keeps a 6% safety margin, so with 5000 typed the safe target is 4,700,000 bytes. A file of 4,712,343 bytes is 12,343 bytes over that line, so it is compressed.
How many pages fit in 5MB?
In our tests a 24 page scan came out at 2,934,776 bytes on the sharpest setting, about 120 KB per page. At that rate around 38 scanned pages would fit, but this is an estimate, and pages with photos are heavier.
Will compressing to 5MB make my PDF blurry?
Not much. For a 5 MB target the first and sharpest attempt usually fits, which renders A4 pages about 714 pixels wide at JPEG quality 78%. Typed text stays readable; very small print looks softer.
Can I keep selectable text when compressing to 5MB?
Not with this tool, because it rasterizes every page. If the text or a digital signature must stay, remove unneeded pages, split the file, or export it again from the original document instead.
Is my PDF uploaded to a server?
No. Dokurapi reads and compresses the file inside your browser tab. Nothing is sent to a server, and the original file on your device is not changed.

Sources

  1. Prefixes for binary multiples, NIST
  2. HTMLCanvasElement: toDataURL() method, MDN Web Docs

Need help?Result not quite right, or unsure about a form rule? Ask Dokurapi support on WhatsApp. Please do not send personal documents in chat.

Chat on WhatsApp

Related articles

Try Dokurapi for Free

No account needed. Pick a tool, drop in a file, and download the result, free.