How to Optimize Images for Your Website: Size, Format and Speed

Last updated: November 23, 2026

Images are often the heaviest part of a web page, and slow pages lose visitors. You do not need technical skills to fix this. Four habits make the biggest difference: use the right dimensions, choose a modern format, compress sensibly and let images load late when they are not yet visible. Here is each step with numbers from our own tests.

Step 1: use the right dimensions

A photo straight from a phone can be 4000 pixels wide, but a blog column might display it at 800 pixels. The browser downloads every pixel anyway. Resize to about twice the displayed width at most, so it stays sharp on high-resolution screens. In our resolution test, halving the width and height reduced a JPG to about 28% of its size.

Step 2: choose a modern format

In our format test, WebP at quality 85 was about 18% smaller than JPG at quality 85. For photos, WebP is a good default, and for logos with transparency it beats PNG. Keep JPG as a fallback if you need maximum compatibility. Convert with JPG to WebP or PNG to WebP.

Step 3: compress sensibly

Quality 75 to 85 suits most web photos. Our quality test showed quality 85 at about 56% of a quality-95 file, with little visible difference. Never go to 100.

Step 4: load images late and avoid layout jumps

A worked example

Say you have a 4000 x 3000 phone photo of 4.5 MB for a blog column of 800 pixels. Resize to 1600 pixels wide, which is 40% of each side, and our test suggests the JPG falls to about a quarter or less of its size, around 1 MB or lower. Save as WebP and you save roughly another fifth. The photo looks the same on screen and loads many times faster. These are estimates from our averages, and your own photo will differ, so check the size after exporting.

A checklist you can reuse

CheckTarget
Displayed widthExport at no more than twice the displayed width
FormatWebP for photos, with JPG as backup; PNG or WebP for logos
Quality75 to 85
File sizeUnder about 200 KB for most blog photos
LoadingLazy-load images below the fold
Alt textA short, honest description of every image

Alt text matters for accessibility and for search. Describe what the picture shows in plain words.

Social sharing images

When your page is shared, social sites show a preview image. See our guide to link preview image sizes for the right dimensions.

Frequently asked questions

What is the best image size for a website?

Export at no more than about twice the width it is displayed, and keep most photos under about 200 KB.

Should I use WebP or JPG?

WebP is usually smaller. Use JPG as a fallback if you need maximum compatibility.

What does lazy loading do?

It delays loading images until the visitor scrolls near them, which speeds up the first view.

Does image size affect search ranking?

Page speed is one of many factors, so lighter images help, though they are not a guarantee of rankings.

Related tools and guides