On most web pages, images add up to more bytes than any other kind of file, according to the HTTP Archive's yearly Web Almanac. So when a page is slow, the images are the sensible place to start measuring. You need two things: the total, and a list showing which images make it up.
Method 1: your browser's developer tools
This is exact, costs nothing, and works on any page, including ones behind a login.
- Open the page in Chrome, Edge or Firefox.
- Open the developer tools (F12, or Cmd+Option+I on a Mac) and choose the Network tab.
- Tick "Disable cache", so that every file is downloaded fresh.
- Choose the image filter. It is labelled Img in Chrome and Edge, and Images in Firefox.
- Reload the page, then scroll to the bottom so that lazy-loaded images are fetched as well.
- Sort by the Size column. The bar at the foot of the panel shows the number of requests and the total transferred.
To see whether one image is bigger than it needs to be, find it in the Elements tab in Chrome and hover over its address. The tooltip shows the size it is drawn at and the size of the file's own pixels. If the file is much more than twice as wide as it is drawn, it carries pixels nobody sees.
Method 2: PageSpeed Insights
Enter the page address at pagespeed.web.dev. The image insight in the report lists images that could be smaller and estimates the saving for each. It shows only the images it considers wasteful, so it is a to-do list and not a full inventory. Our guide to those warnings explains each suggestion.
Method 3: an image analyser
SquishPixel's website image checker takes a page address and lists every image it finds there, with the file size of each and an estimate of what could be saved. Free use is limited each day. It reads the public page, so anything behind a login needs method 1.
Reading the numbers
- The total. There is no official limit, so compare it with the rest of the page. If the images come to several megabytes and the text and code to a few hundred kilobytes, the images are your problem.
- The largest few. Weight is rarely spread evenly. Two or three images often account for most of it. Start there.
- File size against display size. A file more than twice as wide as the space it is shown in should be resized.
- Format. Look for JPEG and PNG where WebP or AVIF would do. A photo saved as PNG is the most expensive mistake.
- Animated GIFs. One is often the heaviest single file on a page.
- Images that are loaded but not seen. Images far down the page without lazy loading, every slide of a carousel, and images hidden with CSS on small screens are usually all downloaded anyway.
Measure the right pages
Check one page of each type: the home page, a category or listing page, a product or article page, and any landing page you advertise. Templates differ, and the page you look at most is rarely the one visitors arrive on.
Check a phone-sized view as well as the desktop one, because responsive pages send different files to each. In the developer tools, switch on device emulation, pick a phone and reload.
Then fix in order of size
- List the images from largest to smallest.
- For each one, resize it, choose the right format and compress it. Our guides to compressing and choosing a format cover the detail.
- Measure again and write down the new total.
Keep that figure. Image weight creeps back as new content is added, and a number to compare against is the only way to notice.