Image compression for the web: JPEG, WebP and AVIF
Reviewed 17 November 2026 · 6 min read · Written and maintained by Toolnexo
Every few years a new image format arrives and the advice column rewrite itself. The format wars matter less than the decision behind them: what is this picture for? Get that right and the format choice mostly makes itself.
The defaults I actually use
- Photographs: WebP at quality 75–85. It's the safe modern choice — widely supported, well-compressed, fast enough to encode.
- AVIF when I need the extra squeeze and can accept slower encoding; support is good in current browsers but patchier in older software.
- Screenshots and text: PNG, or WebP lossless when I need smaller without artefacts. Lossy formats blur small text.
- Logos and icons: SVG if the artwork is vector. Otherwise PNG with transparency.
- Animation: WebP, or actual video. Animated GIF is a museum piece that costs everyone bandwidth.
Quality numbers are not a promise
A "quality 80" JPEG and a "quality 80" WebP do not look alike — encoders interpret the number differently, so comparing settings across formats is meaningless. Judge the output on the picture: zoom into edges, skin tones, text and gradients. Banding in skies and halos around high-contrast edges are the tells.
Compression also strips metadata. Re-encoding through a canvas removes EXIF — including GPS coordinates and camera details. That's a privacy win, but it also removes orientation data, which is why pixels must be rotated correctly before export. Our tools do that; some don't, and you get sideways photos.
Sizing beats compression
The biggest saving almost never comes from the encoder — it comes from sending fewer pixels. A 4000-pixel photo displayed in an 800-pixel card is wasting bandwidth no matter how cleverly compressed. Resize first, then compress. That order matters.
Where you control the website, serve responsive sizes with srcset and let the browser pick. One "universal" hero image is the most common performance mistake I see.
Do it privately
Our image tools decode and re-encode on a canvas in your browser. Photos are never uploaded — that's the whole point. The practical limit is your device's memory; very large images can fail on older phones, so resize in stages if you hit a wall.
And keep the original until you've checked the result at full size. JPEG, WebP and AVIF are lossy — whatever detail was discarded is gone for good.
Put it into practice
Image Compressor
Re-encode photos as JPEG at a quality you control — with before/after file sizes so the trade-off is explicit, all on canvas.
Runs in your browserWebP Converter
Convert any decodable image to WebP, JPEG or PNG — and WebP back to universal formats — with quality control, entirely inside your browser.
Runs in your browserAVIF Converter
Convert a JPG, PNG, WebP, GIF, BMP or TIFF image to AVIF on our server — upload, wait a few seconds, download the .avif.
Runs on our serverImage Resizer
Resize images by width, height, fit-inside or exact dimensions on canvas — aspect-ratio aware, with a preview and direct download.
Runs in your browserOther guides
- How to merge PDFs without uploading them6 min · 17 November 2026
- OCR a scanned PDF: accuracy, limits and privacy7 min · 17 November 2026
- Compress a PDF without destroying readability6 min · 17 November 2026