Image Compressor
Drop in your photos, pick a quality level, and get smaller JPG, PNG, or WebP files in seconds — every compression happens right in your browser, nothing is uploaded.
Higher quality keeps more detail but produces a larger file. Applies to JPEG and WebP — PNG is lossless and ignores this setting.
Downscales the longest side of large images before compressing. Choose "No resize" to keep the original pixel dimensions.
Drop images here or click to browse — JPG, PNG or WebP, up to 10 files
All compression runs locally in your browser — your images are never uploaded or sent to a server.
Why shrinking a photo's file size still matters
A phone camera or screenshot routinely produces JPEG or PNG files in the 2–15 MB range, yet almost none of that data is needed to display the image on a screen, in an email, or on a web page. Large images slow down page loads, eat into email attachment limits (most inboxes cap total attachments around 20–25 MB), and quietly consume mobile data and device storage. Compressing an image trades invisible or barely-visible detail for a dramatically smaller file — the same photo that looks identical on a 1920×1080 screen can end up a tenth of the size once quality and dimensions are tuned for how it will actually be viewed, rather than for how it was captured.
How the three controls work together
- Quality sets how aggressively JPEG and WebP throw away data during re-encoding; it has no effect on PNG, which is always lossless.
- Max dimension shrinks the pixel grid itself before compression runs — fewer pixels means fewer bytes at any quality setting, and it's the single biggest lever for photos taken at 12+ megapixels.
- Output format lets you convert between JPEG, PNG, and WebP; converting a photo-like PNG to JPEG or WebP is often where the single largest size drop comes from, because PNG's lossless method is a poor fit for photographic gradients and sensor noise.
- Drop up to ten files at once, watch the before/after size and percentage saved appear per file, then download individually or as a batch — nothing leaves the browser tab at any point.
What "quality" is actually doing to the pixels
JPEG and WebP don't store a picture as a plain grid of pixel colors — they split the image into small blocks, transform each block's color pattern into a set of frequency components (roughly: how sharply color changes from one edge of the block to the other), and round those components to fewer values. Quality 100 rounds barely at all, so almost nothing is lost. Quality 60 rounds aggressively, discarding the subtle frequency components the eye is least sensitive to first — sharp edges and flat color survive; fine texture and soft gradients are what actually leave the file. That's why dropping from quality 100 to 80 barely changes what you see but can cut the file size by more than half, while dropping from 40 to 20 saves comparatively little extra and starts showing as blocky patches. PNG skips this transform entirely: it compresses losslessly with a dictionary-based method (similar in spirit to a zip file), which is exactly reversible but far less effective on photographic noise.
Worked examples
1. A 4032×3024 phone photo, 6.8 MB JPEG saved at quality ~95. Re-encoding at quality 80 with no resize typically lands around 1.1–1.4 MB — roughly 80% smaller — because the camera's original JPEG was saved at a much higher quality than most screens can distinguish from 80.
2. The same photo, quality 80 plus a 1920px max dimension. Scaling 4032×3024 down to 1920×1440 cuts the pixel count to about 23% of the original (1920×1440 ÷ 4032×3024 ≈ 0.227), and file size roughly tracks pixel count at a fixed quality, so the 1.1–1.4 MB result from example 1 typically drops again to somewhere around 250–350 KB — under 5% of the starting 6.8 MB — with no visible loss on any normal screen.
3. A 900 KB PNG screenshot with no transparency. Converting it to JPEG at quality 85 commonly produces a 120–180 KB file, an 80%+ reduction, because PNG's lossless compression can't exploit smooth gradients and photographic-style content the way JPEG's quantization can — but converting a PNG that relies on transparency to JPEG will flatten it onto a solid background, so check for transparency first.
Choosing a quality setting
| Quality range | Typical use | What to expect |
|---|---|---|
| 90–100% | Archival copies, print-bound images | Minimal size reduction, no visible loss |
| 75–85% | Website photos, social media uploads | 50–80% smaller, visually identical on screen |
| 55–70% | Thumbnails, image-heavy galleries | Noticeably smaller; very close inspection may show softness |
| Below 40% | Rarely worth it | Visible blocky artifacts around edges and text |
Mistakes that quietly undo the savings
- Re-compressing an already-compressed JPEG repeatedly. Each JPEG re-encode re-applies quantization on top of whatever was already discarded — a file saved at quality 80, then later re-opened and re-saved at quality 80 again, loses a little more each round (generation loss), even though the quality number never changed.
- Compressing a PNG that needs to stay a PNG. Logos, icons, and screenshots with sharp text or transparency usually get larger, not smaller, when forced through JPEG's photographic model — keep those as PNG, or convert to WebP, which supports transparency and still compresses well.
- Ignoring the max dimension option on modern camera photos. A 48-megapixel phone photo displayed at 1200px wide on a blog post is carrying roughly 30× more pixel data than the page will ever render — resizing first, then compressing, saves far more than compression alone.
- Not checking the before/after numbers. A handful of images — particularly small, already-optimized ones — come out larger after re-encoding; this tool shows the size for every file specifically so you can skip those instead of downloading a "compressed" file that isn't actually smaller.
What compression here doesn't do
This tool re-encodes pixels through the browser's canvas — it doesn't run the specialized lossless optimizers dedicated command-line tools use (stripping unused PNG palette entries, rewriting Huffman tables byte-for-byte), so a PNG re-saved as PNG here will shrink only slightly. It also doesn't read or preserve EXIF metadata — camera model, GPS location, capture date, orientation tags — or embedded color profiles beyond what the canvas itself applies, which matters if you need those details kept intact. And it can't compress formats the browser can't decode natively, such as HEIC or RAW camera files; convert those to JPEG or PNG with another tool first, then compress here.
Sources & further reading
- MDN Web Docs — image file types on the web and when to use JPEG, PNG or WebP
- MDN Web Docs — canvas toBlob(), the browser API this tool uses to re-encode images
- W3C — the PNG specification, covering lossless compression and transparency
- ISO — JPEG (ISO/IEC 10918) standard behind lossy photographic compression
Frequently asked questions
How does an image compressor make JPG, PNG, or WebP files smaller?
This tool draws each image onto an in-browser canvas and re-encodes it with a fresh quality setting — for JPEG and WebP, a lower quality percentage lets the encoder throw away less-visible detail in exchange for a much smaller file, often 50–80% smaller at quality 70–85 with little visible difference. PNG is a lossless format, so the quality slider doesn't apply to it, but re-encoding a PNG through canvas can still shrink it a little by rebuilding the compression stream. For the biggest savings on photos, also try the max dimension option: an image resized from 4000px down to 1920px wide before compression can end up a fraction of its original size, since fewer pixels means fewer bytes at any quality level.
Should I compress as JPEG, WebP, or PNG — what's the difference?
JPEG is the classic choice for photos: it compresses well at quality 70–85 but doesn't support transparency and can show blocky artifacts at very low quality. WebP is a newer format that typically produces 25–35% smaller files than JPEG at the same visual quality, and it does support transparency, which is why "Keep original format" defaults to WebP output for images that were already WebP. PNG is lossless and the right choice for screenshots, logos, and graphics with transparency or sharp edges — compressing a photo as PNG usually makes it larger, not smaller, so this tool lets you convert a PNG photo to JPEG or WebP for a real size reduction if it doesn't need transparency.
Will resizing to a smaller max dimension blur my image?
Choosing a max dimension like 1920px or 1280px permanently reduces the pixel width and height of images larger than that value, which is exactly what shrinks the file size further — a 6000×4000 photo scaled down to 1920×1280 has far fewer pixels to store. On a screen, browser, or social media post the result usually looks identical, since most displays can't show more detail than that anyway. But the resize can't be undone, and it will look soft if you print the file large or zoom in a lot afterward — keep "No resize" selected if you need to preserve the full original resolution and only want the quality slider to reduce file size.
Is there a limit on file size or how many images I can compress at once?
You can compress up to 10 images in one batch; if you select more, the extra files are skipped and a message tells you so. There's no hard file-size limit enforced by the tool itself, but very large images (many megapixels) take longer to decode and re-encode because everything happens on your device's CPU rather than a server, and extremely large batches can use a noticeable amount of memory in the browser tab. If a particular image fails to process, it's flagged individually so the rest of your batch still completes.
Are my photos uploaded anywhere, and why is a compressed file sometimes bigger than the original?
No — every step, from reading the file to drawing it on a canvas to re-encoding it, happens locally in your browser tab; nothing is uploaded, and closing the tab clears everything. Occasionally a "compressed" file comes out larger than the original — this happens when the quality slider is set very high, when a small already-optimized image is re-encoded, or when converting a simple PNG graphic to JPEG adds overhead it didn't have before. Because this tool always shows the before-and-after size for every file, you can compare and simply skip downloading any result that isn't actually smaller, or lower the quality slider and try again.