Skip to content
WebTricks

Image compressor & converter

Compress and convert images to WebP, AVIF, JPEG or PNG right in your browser. Resize, tune quality, compare sizes — nothing is uploaded.

Quality 75

What this image compressor does

Drop one image or a whole folder of PNG, JPEG, WebP or AVIF files and get smaller files back in the format you choose. Each image is decoded, optionally downscaled to a maximum width, and re-encoded with the jSquash WebAssembly codecs (libwebp, libavif, mozjpeg and oxipng) inside a Web Worker, so the page stays responsive even for a batch of 20-megapixel photos. Every row shows the original and new byte sizes with the percentage saved, and a summary line adds them up. Download files one by one or grab the whole batch as a single ZIP. Nothing is uploaded.

How to use it

  1. Drop images onto the dashed area or click it to pick several files at once. They start compressing immediately with the current settings.
  2. Choose the output format — WebP (default), AVIF, JPEG or PNG.
  3. Move the quality slider (1–100). It is disabled for PNG, which is lossless.
  4. Optionally set max width in pixels; 0 keeps the original size.
  5. Changed a setting after the fact? Click Apply new settings to re-encode every image from its original, not from the previous result.
  6. Click the per-row download button, or Download all as ZIP to save the batch in one archive (the ZIP is built in the browser too).

WebP vs AVIF vs JPEG vs PNG

Numbers below are typical for a 1600px photo; your mileage depends on the content. The full comparison with sample images is in WebP vs AVIF.

FormatLossy / losslessAlphaTypical size vs JPEG q80Encode speedBrowser support
JPEGlossyno100% (baseline)fasteverything
PNGlosslessyes3–10x larger for photosmediumeverything
WebPbothyes25–35% smallerfastall current browsers
AVIFbothyes40–60% smallerslow (seconds)Chrome, Firefox, Safari 16+

Rules of thumb:

  • Photos for the web — WebP at 70–80 is the safe default. AVIF at 50–65 looks the same and is noticeably smaller, but encoding takes a few seconds per image in the browser.
  • Screenshots and UI with text — WebP at 85–90, or PNG if the text must stay razor sharp. JPEG at any quality rings around text edges.
  • Logos and icons with transparency — WebP or PNG. Never JPEG.
  • Thumbnails — set max width to the rendered size times 2 for retina screens (a 300px card wants a 600px image), then compress. Downscaling usually saves more bytes than any quality setting.

Quality settings in practice

The quality number is not a percentage of “how good it looks” — each codec maps it differently. A quick reference:

QualityWebPAVIFJPEG
90–100near-lossless, largeoverkillarchival
75–85visually identical for photosvery high qualitystandard web quality
60–75small, fine at normal zoomsweet spotvisible softness
below 50blocky in gradientsstill usable for backgroundsobvious artifacts

Dark gradients and skies show banding first; faces and fine texture show blurring. If a hero image looks wrong at 70, try 80 before giving up on the format — the size difference between 70 and 80 is often only 10–15%.

Serving the result

Ship modern formats with a JPEG fallback using picture so old browsers still get an image:

<picture>
  <source srcset="/hero.avif" type="image/avif" />
  <source srcset="/hero.webp" type="image/webp" />
  <img src="/hero.jpg" width="1600" height="900" alt="…" loading="lazy" />
</picture>

Set width and height on the img to avoid layout shift, and keep the LCP hero image out of loading="lazy". Smaller files improve Largest Contentful Paint directly, which is where most of the Core Web Vitals gain comes from.

  • Image to Base64 — inline a tiny compressed icon as a data URL after shrinking it here.
  • SVG optimizer — for vector artwork, optimize the SVG instead of rasterizing it.
  • Favicon generator — build the 16–512px icon set from a square source image.
  • Aspect ratio calculator — work out the height for a given max width before resizing.
  • WebP vs AVIF — side-by-side samples and when each format wins.

FAQ

Are my images uploaded anywhere?

No. Decoding, resizing and encoding all run locally in a Web Worker using WebAssembly codecs (the same jSquash/Squoosh codecs). The file never leaves your device, so screenshots with private data are fine.

Which quality should I pick?

Start at 75 for WebP and JPEG photos and 60 for AVIF, then look at the preview. Graphics with text, flat colors or sharp edges usually need 85 or more, or PNG if they must stay pixel-perfect.

Why is the WebP bigger than my original?

The original was probably already heavily compressed (a low-quality JPEG or an optimized WebP) and you re-encoded it at a higher quality. The result badge turns red with a plus sign when that happens — lower the quality or keep the original.

Does it keep transparency?

WebP, AVIF and PNG keep the alpha channel. JPEG has no transparency, so transparent pixels are flattened to black when you choose JPEG — convert logos and UI graphics to WebP or PNG instead.

What does the max width setting do?

If the image is wider than the number you enter, it is downscaled to that width with the aspect ratio preserved before encoding. 0 keeps the original dimensions. Images already narrower than the limit are never upscaled.

Can I compress several images at once?

Yes. Select or drop as many files as you like; they are compressed two at a time in a Web Worker with the current settings. Download each result individually or click Download all to get a single ZIP built in your browser.

Is the PNG output lossless?

Yes. PNG is always lossless here, which is why the quality slider is disabled for it. Choosing PNG is useful to convert a WebP or AVIF back into a widely supported format, not to shrink photos.