How to compress an image to 40 KB in 3 steps
- Add your image — drop a JPG, PNG or WebP above or click to browse. Nothing is uploaded; the image stays on your device.
- Press “Compress to 40 KB” — the tool automatically searches for the highest JPG quality whose file fits 40 KB, and only reduces the dimensions if quality alone cannot get there.
- Download the result — you see the original size, the final size and the final dimensions before you download, including an honest note if the dimensions had to be reduced.
Who needs an image under 40 KB?
This page exists for form and portal photo limits in the 40 KB range, and fast-loading thumbnails for listings and profiles. Instead of guessing with a quality slider and re-saving five times, you state the limit once and the tool searches for you: first quality at full size, then — only if needed — smaller dimensions, until the file fits at or under 40 KB.
Forty kilobytes is a comfortable size for an on-screen ID or profile photo: small enough for any form, large enough to stay recognisable and clean.
How it works
The image is decoded locally in your browser and drawn onto a canvas. It is first encoded as JPG at 92% quality. If that already fits 40 KB, you are done. If not, a binary search between 5% and 92% quality finds the highest quality that fits, keeping the full dimensions. Only when even the lowest quality is still too large does the tool step the dimensions down by 15% at a time (re-encoding at 70% quality) until the file fits — and when that happens, the result line says so and gives the final dimensions. The output is always a JPG at or under 40 KB (40960 bytes), and because everything happens on your device, your image is never uploaded.
Worked example
A 1.8 MB JPG compressed to 40 KB keeps most of its dimensions in this example and finishes at just under 40 KB — the quality search does most of the work, with only a small dimension step if your photo is unusually detailed.
Frequently asked questions
Will my compressed image be exactly 40 KB?
No — it will be at or under 40 KB, never padded up to it. The tool searches for the highest quality that fits within the limit, so the result is usually just a few KB below it. “Under the limit” is what upload forms actually require.
Why did the dimensions of my image change?
Only when there was no other way: JPG quality has a floor, and a detailed full-size photo cannot always reach 40 KB on quality alone. In that case the tool reduces dimensions step by step and tells you the final pixel size in the result line.
Why is the output always JPG?
JPG gives the smallest file for photographs and is accepted by every form and portal. PNG has no quality control, so hitting an exact size with PNG is unreliable — that is why this page, like the main Loona compressor's target mode, outputs JPG.
What does KB mean here — 1000 or 1024 bytes?
This tool counts 1 KB as 1024 bytes, so the target is 40960 bytes. Some portals count 1000 bytes per KB; if yours does, your file at or under 40 KB (1024-based) is still within a few percent — for the strictest portals, pick the next size down to be safe.
Is my image uploaded to a server?
No. Compression happens 100% in your browser using the Canvas API. Your images never leave your device.
Is this 40 KB compressor free?
Yes — completely free, with no signup, no watermark and no limit on the number of images.
More free photo tools
Compress photos to any exact KB size with the full tool.
Convert JPG, PNG and WebP both ways, with quality control.
Compress any image to 10 KB or under, automatically.
Compress any image to 20 KB or under, automatically.
Compress any image to 30 KB or under, automatically.
Compress any image to 150 KB or under, automatically.
Compress any image to 300 KB or under, automatically.
Compress any image to 500 KB or under, automatically.
Compress any image to 1 MB or under, automatically.
Compress any image to 2 MB or under, automatically.
Resize by pixels, cm or inches, with a print DPI setting.