PDF

How to compress a PDF to a specific size (any KB limit)

Type your own limit, read the exact bytes, and know in advance when a target is out of reach. Six custom targets measured on two synthetic scans.

Updated ยท 10 min read

Screenshot of the Compress PDF tool tool on Dokurapi
Screenshot of the related Dokurapi tool. All processing runs in the browser.

To compress a PDF to a specific size, open the Compress PDF tool, choose your file, type the limit in KB into the Custom target box, press Compress PDF, and read the Output line before you download. The custom number overrides the preset menu, so you are not stuck with 100 KB, 200 KB, 500 KB, 1 MB or 2 MB. The tool aims 6% under the number you type, keeps the first attempt that fits, and tells you plainly when the limit cannot be reached. Everything runs in your browser tab, and the PDF is never uploaded.

Odd limits are common. A scholarship form may cap a file at 150 KB, a job portal at 750 KB, a campus system at 1.5 MB. This guide explains what to type for each kind of limit, how the tool picks a result, what we measured on six custom targets, and what to do when the target is out of reach. For the general theory of PDF size, start with how to reduce PDF size.

Steps to compress a PDF to any size you choose

The whole job is four moves on one page, with no account. Keep your original file; the tool never changes it.

  1. Read the exact limit on the form. Note the number and the unit. "Max 1.5 MB" and "max 1500 KB" are the same limit for our tool.
  2. Choose one PDF and type the limit in KB. Use the Custom target (KB) box. 1.5 MB becomes 1500, 3 MB becomes 3000. Whatever the Target size menu shows, a number in the custom box wins.
  3. Press Compress PDF and read the result. Green text means the safe target was reached. The Output line shows the size in KB and the exact number of bytes.
  4. If the target was not reached, change the input, not the setting. Remove pages, split the document, or rescan in grayscale, then run it again.
Four steps: read the limit and unit on the form, type it in KB in Custom target which wins over the menu, compress and read the Output line in exact bytes, and if not reached remove pages, split the file or rescan in grayscale
The custom box is the only setting you need. If the result misses, the fix is in the file, not in the tool.

Before you start, check whether you need to compress at all. A PDF that is already under the limit should be uploaded as it is. The PDF size checker answers in a second, and it accepts the same custom number.

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

Open the Compress PDF tool

What to type for KB, MB and odd limits

The custom box always takes kilobytes, and the tool treats 1 KB as 1,000 bytes. That matches the decimal prefixes defined in the SI system, where kilo means 1,000. Some systems count 1 KB as 1,024 bytes, which NIST notes is properly called a kibibyte (KiB). The tool's 6% safety margin covers both readings, so you never need to convert.

Table: form says 150 KB type 150, safe ceiling 141,000 bytes; 300 KB type 300, 282,000 bytes; 750 KB type 750, 705,000 bytes; 1.5 MB type 1500, 1,410,000 bytes; 3 MB type 3000, 2,820,000 bytes; with extra room if the portal counts 1 KB as 1,024 bytes
The safe ceiling is your number times 1,000 times 0.94, taken straight from the tool code. A portal that uses 1,024 bytes per KB gives you even more room.
  • The form says MB. Multiply by 1,000: 1.5 MB is 1500, 2.5 MB is 2500.
  • The form says a range, such as "100 to 300 KB". Type the upper number. The lower number is rarely enforced, and our tool will not pad a file to reach it.
  • The form gives no unit, only "max 1". Ask, or assume MB if it is a document portal. Typing 1 would mean 1 KB, which no PDF can meet.
  • Two limits apply, for example "each file 500 KB, total 2 MB". Compress each file to the per-file limit first, then check the total.

The smallest value the tool accepts is effectively 1 KB, because the code never sets a ceiling below 1,000 bytes. In practice a scanned A4 page cannot get anywhere near that, as the next sections show.

How the tool decides the result

Compression here means rasterizing. Each page is drawn onto a canvas at a set scale and saved as a JPEG at a set quality, then all pages are packed into a new PDF. The tool tries a fixed ladder of combinations, from the sharpest to the smallest, and stops at the first file that is under your safe ceiling.

Grid of 12 attempts: page scale 1.2 at 714 px, 1.0 at 595 px, 0.82 at 488 px and 0.68 at 404 px on an A4 page, each tried at JPEG quality 78, 64 and 50 percent, numbered 1 to 12 in order
Up to 12 attempts: four page scales times three JPEG qualities. Pixel widths are for an A4 page. In our test, 750 KB stopped at #1, 350 KB at #3 and 150 KB at #11.

Two consequences follow from this design, and both surprise people.

  • The result is "at most", not "exactly". If the very first, sharpest attempt already fits, the tool keeps it, even if it is far below your limit. A 750 KB target can come back at 480 KB. That is deliberate: the file is as sharp as the ladder allows.
  • If nothing fits, you still get a file. The tool keeps the smallest of all attempts and says the target was not reached. You can download it and see how close it came.

Because every page becomes an image, selectable text, links, form fields and digital signatures are lost in the output. If your PDF was signed with a certified digital signature, do not compress it. Ask the issuer for a smaller copy instead. Our guide on compressing a PDF without losing quality covers when rasterizing is a bad idea.

What we measured on six custom targets

We ran the same code that serves dokurapi.com in a local copy in Chrome on 26 October 2026. The test files were synthetic scans built for the purpose: a 4-page letter of 3.76 MB and a 12-page bundle of 10.77 MB, both with paper texture and fictitious text. No real documents were used.

Results table: 4-page scan of 3.76 MB reached 150 KB at 135,766 bytes after 11 attempts, 350 KB at 318,770 bytes after 3 attempts, 750 KB at 480,471 bytes after 1 attempt; 12-page scan of 10.77 MB reached 1500 KB at 1,402,205 bytes after 1 attempt, but 300 KB and 60 KB were not reached, smallest result 344,416 bytes after 12 attempts
Four of six targets were reached. The two misses were the same 12-page file, whose floor was about 344 KB.
Target typedSafe ceilingOutputStopped atTime
150 KB (4 pages)141,000 B135,766 B#11, 404 px, 64%22.7 s
350 KB (4 pages)329,000 B318,770 B#3, 714 px, 50%5.1 s
750 KB (4 pages)705,000 B480,471 B#1, 714 px, 78%1.2 s
1500 KB (12 pages)1,410,000 B1,402,205 B#1, 714 px, 78%4.7 s
300 KB (12 pages)282,000 B344,416 B, missedall 1252.4 s

The 1500 KB run came within 8,000 bytes of the ceiling on the first attempt, which shows how much a 12-page scan weighs even at the sharpest setting. The 150 KB run had to walk almost the whole ladder. Your own files will land elsewhere, because the size depends on how much detail the pages hold, but the pattern holds: the more pages and the tighter the limit, the further down the ladder the tool has to go.

Dokurapi Compress PDF tool with surat-pindaian-4-halaman.pdf of 3.76 MB, Target size menu on 500 KB, Custom target 350, showing Safe target reached, Original 3.76 MB, Output 319 KB (318,770 B), Size difference 3.44 MB
A custom 350 KB target on the 4-page scan: 318,770 bytes, green status. Screenshot of the Dokurapi tool with a synthetic test PDF, 26 October 2026.

When a target is impossible, and how to tell in advance

Every tool that rasterizes has a floor: the smallest file it can make at its lowest setting. For our tool the lowest setting is 404 pixels wide per A4 page at 50% JPEG quality. In our test the 12-page scan could not go below about 344 KB, which works out to roughly 29 KB per page.

That gives a quick rule of thumb before you even open the tool. Multiply the page count by about 30 KB. If the result is above the limit, the target is very likely out of reach for a scanned document, and you should change the document first. A 12-page scan against a 300 KB limit fails; a 4-page scan against 150 KB passes, which is exactly what we saw.

Dokurapi Compress PDF tool with berkas-pindaian-12-halaman.pdf of 10.77 MB and Custom target 60, showing The smallest result was created. The target was not reached, and pages were rasterized, Original 10.77 MB, Output 344 KB (344,415 B)
A 60 KB target for 12 scanned pages is impossible. The tool says so and still offers its smallest result, 344,415 bytes.

Typed documents behave differently. A short PDF exported from a word processor is often already tiny, and rasterizing can make it bigger, not smaller. Check its size first and upload it untouched if it already fits.

What to do when the target is not reached

When the tool reports a miss, pressing the button again will not help. The ladder is fixed, so the same file always gives the same smallest result. Change the input instead, in this order.

  1. Remove pages the form does not need. Blank backs, cover sheets and duplicate pages all count. Check the order and content with our guide on checking PDF page order.
  2. Split the document if the portal has more than one upload slot, and compress each part to the limit.
  3. Rescan at a lower resolution or in grayscale. A phone scan in color with heavy shadows is the worst case. Our guide to scanning a document to PDF shows how to get a cleaner, smaller source.
  4. Build the PDF from photos you have already compressed. Compress each photo with the image compressor first, then combine them with Photo to PDF.
  5. Ask whether the limit is per file or per form. Some portals publish a total limit, not a per-file one.

Our article on what to do when a compressed file is still too big goes deeper into each option, with examples.

Custom target or preset: which to use

The presets exist because some limits are so common that a dropdown is faster. Use them when your form matches exactly; type a custom number for everything else.

Your limitUseRelated guide
100 KBPresetCompress PDF to 100KB
200 KBPresetCompress PDF to 200KB
300 KBCustom: 300Compress PDF to 300KB
500 KB or 1 MBPreset500KB, 1MB
2 MBPresetCompress PDF to 2MB
Anything elseCustom number in KBThis guide

There is one more reason to type a custom number even when the limit looks like a preset. Some government and campus portals say "max 1 MB" but reject a file of exactly 1,000,000 bytes, because they count differently or add metadata during upload. If a file that looked right at the limit was ever refused, type a slightly lower number, such as 900 for a 1 MB limit. The tool then aims for 846,000 bytes, which leaves plenty of room. The same trick helps with office email attachments, which are often capped per message rather than per file. The lower the number, the further down the ladder the tool goes, so check that small print is still readable before you send.

One habit saves most failed uploads: after downloading, check the new file against the limit with the size checker before you submit, and keep the original in case the portal asks for a sharper copy later. If you are preparing several files for one submission, our file size checklist before uploading walks through the whole set.

Frequently asked questions

How do I compress a PDF to a specific size?
Open the Compress PDF tool, choose the file, type your limit in KB in the Custom target box, press Compress PDF, and read the Output line. The custom number overrides the preset menu.
Can I type any number, such as 150 KB or 1.5 MB?
Yes. Type the limit in kilobytes: 150 for 150 KB, 1500 for 1.5 MB, 3000 for 3 MB. The tool aims 6% below the number you type.
Why is my file much smaller than the limit I typed?
The tool keeps the first attempt that fits under the safe ceiling, starting from the sharpest setting. If that first attempt is already small enough, it does not enlarge the file to approach the limit.
Does the tool count 1 KB as 1,000 or 1,024 bytes?
It counts 1 KB as 1,000 bytes and then aims 6% lower. If a portal counts 1 KB as 1,024 bytes, its real limit is slightly larger, so the file still passes.
What happens if my target cannot be reached?
The tool tries up to 12 combinations of page scale and JPEG quality, keeps the smallest result, and tells you the target was not reached. You can still download that smallest file.
How can I tell in advance whether a target is realistic?
For scanned pages, multiply the page count by about 30 KB, based on our test where 12 scanned pages bottomed out near 344 KB. If that number is above the limit, remove pages, split the file, or rescan first.
Is my PDF uploaded anywhere?
No. The PDF is read and rebuilt inside your browser tab. The file content is never sent to a server.
Will the compressed PDF still have selectable text?
No. Each page is turned into a JPEG image, so text selection, links, form fields and digital signatures are lost. Do not compress documents whose digital signature must stay valid.

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.