Shrink any photo to under 100KB in seconds
Drop your image in, set 100KB as the target, and download a compressed file ready for email attachments, government forms, job applications, or any upload field with a strict file-size limit. No account needed, and your image never leaves your device.
How to compress image to 100KB (3 steps)
- Upload your image – click the area above or drag and drop a JPEG, PNG, or WebP file.
- Set the target size – type 100 in the KB field (it may already be set for you). Adjust the quality slider if you want more control over sharpness.
- Download – click the download button. Your compressed image is ready instantly.
The tool hits roughly 100KB by automatically reducing JPEG quality until the file crosses under that threshold. Larger images typically need a lower quality setting; small images may barely change at all.
Worked example: a real photo before and after
Say you have a holiday photo shot on a phone. Before compression it looks like this:
| Property | Original | After compression |
|---|---|---|
| File size | 3.4 MB | ~96 KB |
| Format | JPEG | JPEG |
| Resolution | 4032 × 3024 px | 4032 × 3024 px (unchanged) |
| Quality setting | — | ~22% |
The pixel dimensions stay the same; only the JPEG quality coefficient is reduced. The result is a 36× smaller file that still looks fine on a screen or printed at a small size.
How to do this in code (Python & JavaScript)
If you need to automate image compression to a target size in your own project, here are minimal, runnable examples.
Python (Pillow)
# pip install Pillow
from PIL import Image
import io
def compress_to_target(input_path, output_path, target_kb=100):
img = Image.open(input_path).convert('RGB')
quality = 85
while quality > 5:
buffer = io.BytesIO()
img.save(buffer, format='JPEG', quality=quality)
if buffer.tell() <= target_kb * 1024:
break
quality -= 5
with open(output_path, 'wb') as f:
f.write(buffer.getvalue())
compress_to_target('photo.jpg', 'photo_100kb.jpg')
JavaScript (browser canvas API)
// Compress an image File object to approximately targetKB
async function compressToTarget(file, targetKB = 100) {
const img = await createImageBitmap(file);
const canvas = document.createElement('canvas');
canvas.width = img.width;
canvas.height = img.height;
const ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0);
let quality = 0.85;
let blob;
while (quality > 0.05) {
blob = await new Promise(res =>
canvas.toBlob(res, 'image/jpeg', quality)
);
if (blob.size <= targetKB * 1024) break;
quality -= 0.05;
}
return blob; // use URL.createObjectURL(blob) to download
}
Both examples loop through decreasing quality values until the output file is at or below 100KB. The browser tool above uses the same canvas technique — no server involved.
How it works
JPEG compression works by discarding fine color detail that the eye barely notices. A quality value closer to 100% keeps almost everything; a lower value throws away more and produces a smaller file. This tool draws your image onto an HTML5 canvas, then calls canvas.toBlob() repeatedly with decreasing quality until the blob size falls under your target. The whole process runs in your browser using the Canvas API (MDN) — nothing is uploaded anywhere.
PNG files are lossless by nature, so they are converted to JPEG before quality-based compression is applied. If preserving transparency matters, use a dedicated PNG compressor instead.
When to use a 100KB target — and when not to
- Use it for: passport or visa photo uploads, HR portals, government form submissions, email attachments, and any site that rejects files over a set size.
- Not ideal for: print-ready artwork (you need high resolution and quality), transparent images (JPEG drops transparency — keep those as PNG or WebP), or files that are already under 100KB (over-compressing a tiny file just degrades quality for no gain).
- Very large originals (over 20MP) may end up looking soft at 100KB. Resize the image to a smaller pixel dimension first, then compress — a 1200px-wide image at 100KB looks sharper than a 4000px-wide image at the same file size.
Your image stays private
Everything happens entirely in your browser. The file is processed on your own device using JavaScript and the HTML5 Canvas API — it is never sent to any server. You can even disconnect from the internet after the page loads and the tool will still work.
Related tools you might need
Working with data files alongside images? These free tools handle common developer tasks without any sign-up:
- JSON Beautifier – Format, Validate & Minify JSON Online — clean up raw JSON in one click.
- JSON Minifier – Compress & Minify JSON Online (Free) — strip whitespace for smaller payloads.
- JSON Validator – Check & Fix JSON Errors Online (Free) — catch syntax errors fast.
Ready to reduce your image to 100KB? Drop it into the tool above and download your compressed file in seconds.