Writing

How to Compress Images for the Web

A practical guide to quality, dimensions, formats, and the trade-offs that affect page speed.

Images are usually the largest files on a page. Compressing them well improves load time, mobile data use, and Core Web Vitals without making the page look worse.

Start with dimensions

A 4000-pixel photo displayed at 800 pixels wastes bandwidth. Resize to the largest size the layout actually needs, then compress. A two-column layout rarely needs more than 1200 pixels; a full-width hero may need 1600–2000 pixels. Retina screens benefit from up to twice the CSS size, but not from a 6000-pixel original.

Choose the format

  • JPEG for photographs and complex scenes.
  • PNG for logos, screenshots, and images with transparency.
  • WebP for a good balance of quality and size in modern browsers.
  • SVG for icons and simple illustrations.

This site's Image Compressor re-encodes to JPEG at the original dimensions. Use the Image Resizer first if the dimensions are too large.

Pick a quality level

The quality slider trades file size for detail. For photos, 70–80% is often visually indistinguishable from the original at normal viewing size. Text, sharp edges, and gradients need more quality; a screenshot at 60% can look muddy. Always compare at 100% before publishing.

Watch transparency

JPEG does not support transparency. A transparent PNG saved as JPEG may show a black, white, or coloured background. Keep PNG or WebP when the alpha channel matters.

Measure the result

Check the compressed file size, not just the preview. A page with ten images at 300 KB each is 3 MB before any scripts or fonts load. Set a budget: for example, 150–250 KB per content image and under 100 KB for thumbnails.

Do not compress repeatedly

Each JPEG re-encode loses a little quality. Keep the original, compress once for the web, and regenerate from the original if you need a different size. Repeatedly editing and saving a JPEG adds artifacts that no later setting can remove.

Privacy

The compressor runs in your browser, so the image is not uploaded. That matters for screenshots, client work, and personal photos.

ガイド ツールを見る