Compress Image to Specific Size Online

Compress JPG, PNG, WebP, and HEIC images to an exact target size — 100KB, 500KB, 2MB, or any value you choose. Smart binary-search algorithm hits your target without manual trial and error.

Exact target file size (KB or MB) JPG, PNG, WebP, HEIC inputs Batch processing + ZIP download 100% private — runs in your browser

Drop images here or click to upload

Supports JPG, JPEG, PNG, WebP, and HEIC. Multiple files at once.

JPGJPEGPNGWEBPHEIC

Images are processed locally in your browser. Nothing is uploaded.

How to compress an image to a specific size

1

Upload your images

Drag and drop one or many images, or click to browse. JPG, PNG, WebP, and HEIC are all supported.

You can keep adding files while existing ones are still processing.
2

Pick a target size

Choose a preset like 100KB, 500KB, or 2MB — or type any value in KB. The tool aims for that exact size.

Common email and forum limits: 100KB, 200KB, 500KB, 1MB, 2MB.
3

Let the algorithm work

A binary search across JPEG / WebP quality finds the highest fidelity that fits your target. If needed, dimensions are reduced too.

Most images converge in under a second per file.
4

Download your files

Download images one at a time, or grab them all as a ZIP. Filenames include the target size for easy organization.

Original files are never modified.

When you need a specific file size

Government & visa applications

Passport, ID, and visa portals often cap uploads at 100KB, 200KB, or 500KB. Stay under the limit on the first try.

Read the portal’s spec carefully — many also require specific dimensions.

Exam & job application portals

University admissions, civil service exams, and HR systems usually enforce strict per-image limits like 50KB or 200KB.

Use JPEG output for photos and signatures to keep size minimal.

Email attachments

Stay under 5MB or 10MB total per message by compressing each image to a known size before attaching.

For galleries of many photos, target 200KB–500KB per image.

Forums, chat apps & Wikipedia

Many platforms reject images over 1MB or 2MB. Hit those limits without sacrificing usable quality.

Discord allows 8MB free, 25MB Nitro. WhatsApp scales down anything over 5MB.

Web performance & Core Web Vitals

Cap hero images at 200KB and thumbnails at 50KB to keep LCP fast and improve Google rankings.

Aim for under 1MB total image weight per page on mobile.

Storage backups

Archive large photo libraries at a predictable size per file — perfect for cloud quotas and budget storage tiers.

Target 500KB to 1MB for archival JPEGs.

Why this tool

Smart binary search

Up to eight quality probes per pass converge on the highest fidelity that still fits your target.

Dimension fallback

If quality alone cannot reach the target, the tool downscales dimensions automatically until it can.

100% private

Every step runs inside your browser via OffscreenCanvas. Files never touch a server.

Batch friendly

Compress dozens of images in one go and download every result as a single ZIP archive.

Frequently asked questions

How does compress-to-size actually work?

The tool runs a binary search across JPEG or WebP encoder quality (0.1 to 0.95). After up to eight iterations, the highest quality whose output is at or below your target wins. If even the lowest quality is still too large, dimensions are reduced and the search repeats.

Can it always hit the exact target size?

Most of the time yes, within a small tolerance. If the original image is very small or the target is extremely strict (for example 5KB for a 4K photo), the tool returns the smallest result it could produce and flags it as "best effort".

Are my images uploaded anywhere?

No. Everything runs inside your browser using the Canvas API and WebAssembly. Files never leave your device, which is why the tool also works offline once loaded.

What input formats are supported?

JPG/JPEG, PNG, WebP, and HEIC/HEIF (Apple iPhone photos). Output is JPEG or WebP — both compress predictably to a target size.

JPEG or WebP — which should I pick?

JPEG is the safe default: universal compatibility and the smallest files for photos. WebP keeps slightly more detail at very small sizes but is not accepted by every legacy portal.

Will dimensions change?

Only if quality alone cannot reach the target. You can disable this from the settings panel — useful when a portal also requires a specific resolution.

Is there a file count or size limit?

No hard limit. Very large batches are constrained only by your device memory. The tool processes files sequentially to stay responsive.

Ready to hit your target size?

Upload your images and pick any size from 5KB to 20MB. Free, instant, and private.