How to compress images for a website

Images are usually more than half of a web page's weight. Compressing them is the quickest speed win there is, and done right, nobody will notice any change in quality.

Compress JPGCompress PNGCompress WEBPJPG to WEBP

1. Use the right size

Most of the saving comes from size, not compression. A photo straight from a phone is about 4000 pixels wide; a blog column is about 800. Resizing such a photo to the size it is shown cuts its weight by 90 percent or more before any compression.

In every compressor here, click Options and choose Resize: Max 1920px for full-width images, Max 1280px for content images, Max 800px for thumbnails. Images are only made smaller, never larger.

2. Use the right format

Not sure? Read JPG vs PNG vs WebP.

3. Compress by a sensible amount

Each compressor has a Reduce size by setting under Options (50 percent by default). It finds the best quality that reaches that size, and only shrinks the pixel dimensions when quality alone is not enough.

The list shows the original and the new size of every file. All compressors handle many files at once and give you a ZIP. Camera data such as GPS location is removed too, which also saves a few kilobytes.

4. Check the result

Open the original and the compressed image side by side at 100 percent zoom. If you cannot see a difference, compress a little more; if you can, choose a smaller reduction. After uploading, test your page with a speed test such as PageSpeed Insights.

A quick checklist

Frequently asked questions

What is the best image size for a website?

Use the largest width the image is shown at: about 1920 pixels for full-width images and 800 to 1280 for images inside content.

Does compressing images hurt quality?

At sensible settings the change is not visible. Quality 70 to 80 for photos is a good balance.

Which image format loads fastest?

WebP and AVIF give the smallest files. WebP works in every current browser and is the safe default.