Any cap · binary search · min/max band

Compress to a number, not a vibe.

Portals reject 367 KB when they asked for 300. Name any ceiling — or a band like 20–50 KB — and the compressor binary-searches JPEG quality (and only then pixels) until the file on disk is actually inside the numbers.

  • 100% client-side
  • Nothing is uploaded
  • No account
  • Canvas / WebAssembly on your device

Loading compressor…

How the exact-size search works

Generic compressors offer Low/Medium/Extreme and hope the bytes land under your portal’s cap. UnderKB does the opposite: you type the number and it searches for it. For images, it binary-searches JPEG/WEBP quality from 90 down to 30, encoding in memory and checking bytes each pass, until the file is ≤ Maximum KB. If quality 30 still does not fit, it reduces pixel dimensions one step and resumes the quality search — dimension shrink is always last resort because it deletes pixels.

For PDFs that wrap scanned pages, the tool rasterizes pages at a chosen DPI, re-encodes as images, and rebuilds the PDF — because “compress PDF” without rasterizing rarely changes the bytes. Greyscale at 150 DPI is 3–4× cheaper than colour at the same DPI; the DPI-to-KB table on the guide predicts what will fit.

InputPass 1Pass 2Stop
600×800 JPG, 420 KB, cap 50 KBQuality 70 → 110 KB (no)Quality 45 → 48 KB (yes)48 KB done — dimensions untouched
4000×3000 JPG, 4.2 MB, cap 50 KBQuality 30 → 180 KB (no)Shrink to 1200 px long edge, quality 60 → 47 KB (yes)Shrunk once, then quality search
One A4 colour scan, 2.1 MB, cap 200 KB PDF150 DPI greyscale → 160 KB (yes)—Rasterize + greyscale wins

Maximum, Minimum, and the 20–50 KB band

Some portals publish a single ceiling (“≤ 300 KB”); others publish a band (“SSC photo 20–50 KB”). Both are enforced. A 14 KB photo fails SSC just like a 60 KB one. Use the two fields:

  • Maximum = ceiling (e.g. 50). The search never exceeds it.
  • Minimum = floor (e.g. 20). If the quality search lands under the floor, the tool raises quality — or enlarges — to re-enter the band.
  • Set Maximum 50 and Minimum 20 for SSC; set only Maximum 300 for e-Visa.

Do not re-compress a file that already sits inside the band. Re-encoding a 38 KB SSC photo to “make it 35 KB for safety” is pure generation loss — the portal would have accepted 38 KB.

Batch and privacy: what happens in your browser

Drop up to 12 files; each is processed locally with Canvas/WebAssembly. No upload, no queue on a server, no account. You can disconnect the network after the page loads — the byte count shown is the byte count the portal receives. The tool reports the exact final KB and dimensions before you download, so you can check against the notification without uploading to test.

  • PDFs with form fields flatten — fill and flatten fields before compressing.
  • Encrypted or owner-locked PDFs cannot be opened — decrypt first in your PDF reader.
  • Signed PDFs must never be re-encoded — compress the unsigned original, then sign.

Frequently asked questions

How is UnderKB different from Low/Medium/Extreme compressors?

You type the number and it searches for it. UnderKB binary-searches JPEG quality (and only then dimensions) until the file on disk is actually ≤ the KB you typed, rather than guessing a quality level and hoping the bytes fit.

What do Maximum and Minimum KB do?

Maximum is the ceiling. Minimum is the floor when a portal publishes a band, like SSC 20–50 KB — the tool lands inside the band, not merely under the ceiling. Set Maximum 50 and Minimum 20 for SSC.

Will the compressor change my pixel dimensions?

Only if quality 30 still does not hit the cap. The search tries every quality first; shrinking pixels is last resort. Cropping tightly before you drop the file keeps the face sharp and usually avoids any resize.

Can I compress many files at once?

Yes — up to 12 files in one drop, each processed locally in parallel where the browser allows. The byte count shown for each is the byte count the portal receives.

Is anything uploaded?

No. Decoding, quality search, resizing and re-encoding all happen in this tab with Canvas/WebAssembly. Nothing is sent to a server; nothing is stored.