StringToolsStringTools

Image Compressor

Compress JPG, PNG, and WebP images up to 95% smaller. Perfect for WhatsApp, email, and websites. Drag, drop, done — 100% browser-based.

Mitul MandankaFounder, Progragon Technolabs · 15+ years building software
Updated June 20267 min read

Compression Settings

Max Size (MB)
Quality (70%)
Max Width/Height (px)

TL;DR — pick the right format first, then compress

Compression only does half the work — the format matters more. For photographs, use JPEG (universal) or WebP/AVIF (smaller, modern). For logos, screenshots, icons, or anything with sharp edges or transparency, use PNG or lossless WebP. Set photo quality to 75–80% and cap the longest side at 1920pxfor the web. Aim for under 200 KB per web image and under 1 MB per email attachment. The format comparison and target-size tables below give you the exact number for your use case.

JPEG vs PNG vs WebP vs AVIF: which one and when

The single biggest file-size win comes from choosing the correct format, not from cranking the quality slider. Here is how the four formats you'll actually meet on the web compare on the things that matter.

FormatCompressionTransparencyAnimationBrowser support
JPEGLossy onlyNoNoUniversal (every browser, app, printer)
PNGLossless onlyYes (full alpha)No (APNG rarely used)Universal
WebPLossy or losslessYes (full alpha)YesAll modern browsers (Chrome, Edge, Firefox, Safari 14+)
AVIFLossy or losslessYes (full alpha)YesChrome, Edge, Firefox, Safari 16.4+ (Opera partial)

Rough rule of thumb at the same visible quality: WebP is about 25–35% smaller than JPEG, and AVIF is roughly 50% smaller than JPEG. PNG is usually the largest for photos and the smallest for flat-colour graphics, because lossless compression rewards large blocks of identical pixels.

What format should this specific image be?

Match the picture to the format by its content, not by what your camera or app happened to save it as:

  • Photographs & complex gradients — JPEG for maximum compatibility, or WebP/AVIF when you control where it's viewed (your own website). Lossy compression hides millions of subtle colours the eye won't miss.
  • Logos, icons, line art, flat colours — PNG or lossless WebP. JPEG ruins sharp edges with blurry "ringing" artifacts around text and lines.
  • Anything needing a transparent background — PNG, WebP, or AVIF. JPEG cannot store transparency; it fills it with white or black.
  • Screenshots — PNG if there's a lot of text/UI (stays crisp); JPEG or WebP if the screenshot is mostly a photo.
  • Animation — animated WebP (far smaller than GIF). Avoid GIF for anything but tiny, low-colour loops.
  • Print or archival masters — keep a lossless original (PNG or TIFF); compress only the copies you publish.

Lossy vs lossless: the trade-off in plain terms

Lossycompression permanently throws away data the human eye barely registers — fine colour variation and high-frequency detail. It produces dramatically smaller files (often 90%+ savings on photos) but the loss is cumulative: re-saving a JPEG over and over degrades it a little each time ("generation loss"). JPEG, and the lossy modes of WebP and AVIF, all work this way.

Lossless compression rebuilds the image pixel-for-pixel — zero quality loss, but smaller savings. It shines on graphics with large flat areas. PNG is always lossless; WebP and AVIF offer a lossless mode too.

Practical advice: start from the highest-quality original you have, compress once to your target, and keep the original. Never compress an already-compressed JPEG repeatedly — each pass bakes the previous artifacts in deeper.

Recommended target sizes by use case

"How small should I make it?" depends entirely on where it's going. These are practical targets that balance quality against speed and upload limits. Use the tool's quality slider and max-dimension cap to hit them.

Use caseTarget file sizeMax dimensionBest format
Website hero / full-width banner150–300 KB1920px wideWebP / AVIF
In-article / blog image60–150 KB1200px wideWebP / JPEG
Product thumbnail20–50 KB400–600pxWebP / JPEG
Email attachmentUnder 1 MB1600pxJPEG
WhatsApp / messagingUnder 1–2 MB1600pxJPEG
Logo / transparent graphic10–80 KBAs designedPNG / lossless WebP
Government / passport photo upload20–200 KB (per portal rules)Per specJPEG

Two levers cut size faster than the quality slider: resizing (a 6000px photo shrunk to 1920px loses ~90% of its pixels before any compression) and format choice. Reach for those first; only then fine-tune quality.

Questions people ask about compressing images

Does compressing an image lower its quality?

It depends on the mode. Lossless compression (PNG, or the lossless mode of WebP/AVIF) reduces file size with zero quality loss. Lossy compression (JPEG, lossy WebP/AVIF) does discard some detail, but at 75–80% quality the change is invisible on screen for most photos. The trick is to compress once from the original and avoid repeatedly re-saving a JPEG, which compounds the loss.

Should I use WebP or AVIF instead of JPEG?

For your own website, yes — WebP is about 25–35% smaller than JPEG and AVIF roughly 50% smaller at the same visible quality, and every modern browser supports both (Safari since 14 for WebP, 16.4 for AVIF). For an image you'll email, attach to a form, or hand to someone with an unknown device, stick with JPEG for guaranteed compatibility.

Why can't I compress a PNG as small as a JPEG?

PNG is lossless, so for a detailed photograph it has to preserve every pixel — that floor is much higher than JPEG's lossy floor. If a PNG photo is huge, the real fix is converting it to JPEG or WebP, not squeezing the PNG. PNG only wins on flat graphics, logos, and screenshots with large areas of identical colour.

What image format keeps a transparent background?

PNG, WebP, and AVIF all support full alpha transparency. JPEG does not — saving a transparent image as JPEG fills the see-through areas with a solid colour (usually white or black). If you need transparency, never compress to JPEG.

How do I get an image under a specific KB limit for a form?

Government and job portals often cap photos at 20–200 KB. Set a max dimension first (resizing removes the most data), choose JPEG, then lower the quality slider until you land under the limit. This tool lets you target a maximum size directly, so you can hit, say, 100 KB without trial and error.

Are my photos uploaded to a server?

No. All compression runs locally in your browser — your images are never uploaded, stored, or logged. You can verify it in DevTools → Network: compressing an image triggers zero outbound requests. That makes it safe for private photos, ID documents, and unpublished work.