tuliq
Runs in your browser

Image Compressor (Compress to KB/MB)

Compress a photo to an exact target file size — 20KB, 50KB, 100KB, 1MB, or any custom size — the way most exam, passport, government form, and website uploads actually cap file size. Automatically finds the highest quality that still fits your target, so you don't have to guess a quality percentage and check the result repeatedly. A manual quality mode is also available. Runs entirely client-side using the Canvas API — nothing is uploaded.

About this tool

This tool compresses a photo to an exact target file size — 20KB, 50KB, 100KB, 1MB, or any custom size you enter — which is what "compress image" almost always actually means in practice: a government form capping photo uploads at 50KB, a passport or exam application requiring a photo under 20KB, an email attachment limit, or a website's upload cap. Rather than making you guess a quality percentage and check the result over and over, this tool searches for the highest image quality that still fits your target size automatically, so you get the smallest possible quality loss for the size you need. A manual quality mode is also available if you just want a generally smaller file rather than an exact size. It runs entirely client-side using the Canvas API — nothing you upload is ever sent anywhere.

What you can do

  • Compress to an exact target size — 20KB, 50KB, 100KB, 1MB, or any custom size in KB
  • Or use manual quality control if you just want a smaller file, not an exact size
  • See the exact before/after size and quality used
  • Nothing is uploaded — compression happens entirely in your browser

How to use

Step 1

Upload an image and pick a target

Common presets (20KB, 50KB, 100KB, 1MB) or a custom KB value — the exact size most forms and uploads ask for.

Step 2

Compress

The tool automatically finds the highest quality that still fits your target size.

Step 3

Download

Get the compressed JPEG, sized to fit what you needed.

Example

A 3.2 MB photo, compressed to a target of 50KB:

Result

3.2 MB → 48.7 KB (quality 22%)

the highest quality that still fits under 50KB, found automatically rather than requiring manual trial and error.

How your data is handled

This tool is labeled 🟢 Browser: your photo is compressed directly in your browser using the Canvas API — nothing is uploaded to a server, and nothing about it is retained once you leave the page.

Frequently asked questions

How do I compress a photo to exactly 50KB (or 20KB, 100KB, etc.) for a form?+

Pick that size from the presets, or type it into the custom KB field, then click Compress — the tool automatically finds the highest quality setting that still produces a file at or under that size, which is exactly what most exam, passport, and government form uploads require.

Why is the actual output slightly smaller than my target, not exactly equal?+

The tool guarantees the result is at or under your target size, never over it — since JPEG quality can only be set in small steps, the closest fit is usually a little under the target rather than landing on it exactly, which is the safe direction for a form that enforces a hard size cap.

What if my target is smaller than the smallest size the image can reach?+

You get the smallest size the tool can produce (at its lowest quality setting) with a clear indication of the actual size achieved, rather than silently failing — very small targets on a large, detailed photo may not be achievable without visible quality loss.

Does this work for PNG images too?+

You can upload a PNG, but the compressed output is always a JPEG — JPEG's adjustable quality is what makes hitting a specific target size possible; PNG is lossless and doesn't have a quality dial to compress against.

Is my photo uploaded anywhere?+

No — it's compressed directly in your browser using the Canvas API. Nothing here ever leaves your device.

Related tools