Skip to content
Web4tools

How to Compress Images for a Website Without Losing Quality

Web4tools teamUpdated 6 min read

In short

To compress images for a website, first resize them to the largest size they're displayed at (often 1600–2000 px wide), then save photos as WebP or AVIF at quality 70–80 and graphics as compressed PNG or lossless WebP. Most photos end up under 200 KB with no visible difference.

Tools for this: Image Compressor, Image Resizer, PNG to WebP, PNG Compressor, JPG to AVIF

Step by step

  1. 1Resize to display size. Use the image resizer to set a maximum width, such as 1600 px for full-width images or 800 px for in-article images.
  2. 2Choose the format. Use WebP or AVIF for photos, and PNG or lossless WebP for logos and screenshots.
  3. 3Compress. Run the images through the image compressor at quality 70–80 and compare sizes.
  4. 4Add width and height. In your HTML, set width and height attributes (or aspect-ratio in CSS) so the layout doesn't jump while images load.

Why image size matters

Images make up most of the weight of a typical web page. Oversized images slow down the Largest Contentful Paint metric, use mobile data, and cost conversions. Every extra second of load time measurably increases bounce rate.

Step 1: Resize before you compress

A modern phone photo is around 4000 × 3000 px. If your blog column is 800 px wide, even on a high-density screen you need at most 1600 px. Resizing alone typically cuts file size by 80% or more, more than any compression setting.

Step 2: Pick the right format

WebP is supported everywhere and is usually the best default. AVIF is smaller still but slower to encode. Keep JPG only when the image will also be downloaded or emailed, and PNG for graphics with text or transparency.

Step 3: Compress with sensible settings

Quality 75 is a good starting point for photos in WebP or JPG. Check the result at 100% zoom: if you can't see a difference, try 65; if you see blockiness in gradients or around text, go back up.

  • Hero / full-width image: 1600–2000 px wide, under 250 KB.
  • In-article image: 800–1200 px wide, under 120 KB.
  • Thumbnail: 400 px wide, under 40 KB.
  • Logo: SVG if possible, otherwise a compressed PNG.

Step 4: Serve them well

Add loading="lazy" to images below the fold, always include width and height to prevent layout shift (CLS), and use srcset so phones download smaller versions. Most CMSs and image CDNs can automate this once your originals are a sensible size.

Frequently asked questions

What's the best quality setting?

70–80 for photos in WebP or JPG. Graphics usually look perfect after PNG palette compression at quality 80.

Will Google penalise large images?

Not directly, but slow pages score worse on Core Web Vitals, which is a ranking factor, and users leave slow pages.

Are my images uploaded when I compress them?

Not with our tools. Compression happens in your browser.

Try the tools

More guides