EasyTool

Compress an Image to an Exact File Size

Set a target size and the tool hunts for the highest quality that still fits under it, testing up to nine encodes to get there. Pick a preset or type your own number. Output is JPG or WebP, produced on your device.

Upload an image

Drop an image here, or click to browse

JPG, PNG, WebP · Max 50 MB per file

Your image stays on your device. This tool runs entirely in your browser. Your file is never uploaded to our server.

Upload an image

Handles images up to 50 MB. Processing happens on your device — nothing is uploaded.

How does compressing to an exact file size work?

Set a target, drop in an image, and the tool hunts for the highest quality that still fits under it. It does not apply a fixed quality setting. It encodes at quality 100 first, and if that already fits, the image comes back untouched — a file that was small to begin with loses nothing. When quality 100 is too large, a binary search runs through up to nine encodes, halving the search range each time, until it finds the best setting that stays at or under your number. The result card reports the original size, the compressed size, and the quality actually used.

  1. 1Drop or select a JPG, PNG, or WebP file. The limit is 50 MB.
  2. 2Pick a target: 20, 50, 100, 200 or 500 KB, or type any number you need.
  3. 3Choose JPG or WebP output.
  4. 4Download the result. Your original file is never modified.

Which target size should you pick?

The right number comes from wherever the image is going, not from guesswork. The ranges below cover the limits that actually show up in upload forms and platform documentation.

  • 20 KB: forum and community avatars, which usually render at 200 to 400px, and strict government or school portals that reject anything larger.
  • 50 KB: email attachments at corporate gateways, and job or visa application forms with a per-file cap.
  • 100 KB: blog and article images, where it sits comfortably inside most CMS budgets.
  • 200 KB: marketplace listings and product galleries, where images are re-sampled anyway once uploaded.
  • 500 KB: full-width hero images and portfolio pieces that still need to look sharp on a large screen.

Where a fixed target size is actually required

Application forms with a hard cap

Visa, insurance, and school portals often reject any file over a set size without explaining why. A phone photo of a document at 3.1 MB fails immediately and gives no feedback about what went wrong. Setting the target to the number in the form instructions brings the same scan down to fit on the first attempt, and because the tool keeps the highest quality that fits, the text stays readable.

Forum and community avatars

Most forum engines cap profile pictures around 20 KB and display them at 200 to 400px. A 1200px PNG avatar weighing 480 KB is over by a wide margin. Compressed to a 400px WebP at 18 KB, it passes the check and loads instantly on every page of a long thread.

Thumbnail grids and list views

A product grid with 40 thumbnails at 300 KB each ships 12 MB before the page is usable. The same thumbnails at 20 KB each total 800 KB, and at 150px wide nobody can tell them apart. The saving multiplies across every row of the list.

Chat and messaging previews

Messaging apps thumbnail attached photos, but the full file still has to travel first. A 2.4 MB snapshot sent as a 20 KB WebP arrives almost instantly on a slow connection and still looks clean in the chat bubble.

JPG or WebP when the budget is tight?

For a small target, WebP is usually the better pick. It compresses more efficiently than JPG at the same quality, which matters most when every kilobyte counts, and it keeps transparency — a logo can become a 20 KB WebP without losing its clear background. Choose JPG when the receiving system is old or refuses WebP. JPG fills transparent areas with white, which is fine for a photo of a document but changes how a logo looks.

  • WebP: smaller at the same quality, keeps transparency, works in every current browser.
  • JPG: the safest choice for old upload forms, but transparent areas turn white.
  • Both are lossy, so the quality trade-off applies to whichever you pick.

What happens when the target is impossible?

Some images will not make it. A noisy photo full of fine texture — foliage, a crowd, a gravel path — can still sit above a small target even at quality 1, because there is simply too much detail left to encode. A 2000px shot of leaves might bottom out at 34 KB against a 20 KB goal. When that happens the tool returns the smallest encode it can produce and labels it "Smallest possible" rather than pretending the target was met. Resizing to a smaller width is the fix: fewer pixels means the encoder has less to work through.

Should you resize before compressing to a small target?

Yes, whenever the source is large and the target is aggressive. Resizing discards pixels, which is a far bigger lever than quality alone. A 3000px camera photo that stalls at 90 KB under compression will usually slide under 20 KB once it is 400px wide, because there are far fewer pixels to encode. Run the resizer first, then bring the smaller file here. The same applies in reverse: if a target is easy to hit, skip the resize and keep the extra resolution.

Frequently asked questions

Why does the tool run several encodes instead of one?

A single encode at a guessed quality either overshoots the target or wastes quality that would have fit. The tool instead halves the search range up to nine times, which lands on the highest setting that still fits — usually within a percent or two of the best possible result.

What happens if my photo cannot reach the target size?

The tool returns the smallest file it can produce and marks it "Smallest possible" instead of stopping or failing. Images packed with fine detail, such as foliage or crowds, are the usual cause. Resizing the image to a smaller width before compressing almost always solves it.

Why is PNG not offered as an output format?

PNG is lossless, so a quality setting has no effect on its size and there is nothing for the search to tune. Reaching a target file size requires a lossy format, which is why the output is limited to JPG and WebP. Use WebP if you need transparency.

Can I set a target that is not in the preset list?

Yes. The presets are shortcuts; the input next to them accepts any whole number of kilobytes. If a form asks for 37 KB or 150 KB, type it in and the tool aims for exactly that.

Will the tool ever make my image larger?

No. If the image already fits the target at quality 100, it is returned unchanged and no re-encoding happens. The tool also never enlarges an image just to use up the available budget.

Does hitting a small target ruin the image?

It depends on how far the image has to go. Dropping a clean 800px avatar from 260 KB to 20 KB is usually invisible at its display size. Forcing a detailed 3000px photo down to the same 20 KB produces visible blocking, and resizing first gives a far better result.

Which target size works for most websites?

Around 100 KB for body and article images, and up to 200 KB for a full-width hero. The useful test is the size the image is actually displayed at: a 1600px-wide slot rarely needs more than 200 KB, and anything beyond that is wasted download time.

You might also need