Image Compression Analyzer
Short answer
Check image weight, formats and compression savings, plus responsive markup: srcset, width and height, and lazy loading.
What it does not do: It checks at most 15 images and estimates WebP savings without converting them; images set as CSS backgrounds or added by scripts are not included.
What It Does
Checks up to 15 images on a page for format and file size, flags any still served as JPEG or PNG instead of WebP or AVIF, and estimates the bytes you would save by converting them to WebP. A second part checks every `<img>` for responsive markup: a `srcset`, `width` and `height` attributes that prevent layout shift, lazy loading for offscreen images and modern formats.
Why It Matters
Images are often the heaviest part of a page and often its Largest Contentful Paint element. Sending full-size JPEGs to phones wastes data and slows that paint, and images without width and height make the layout jump as they load, which hurts Cumulative Layout Shift.
How It Works
-
Enter a page URL
-
We list the images on the page and check the format and size of up to 15
-
Estimate WebP savings, then check each `<img>` for srcset, dimensions and lazy loading
-
Return a result for each part, with the heaviest images and the ones missing responsive markup
Sample input + output
url: https://developer.mozilla.org/en-US/docs/Web/HTML/Guides/Responsive_images
0 of 2 areas look good · 64/100
Image weight & formats 57/100
Images that could be compressed further: 2.
Images checked: 5 · Total image weight: 394.7 KB · Modern format: 0/5 · Est. savings (WebP): 138.1 KB
Modern image formats (WebP/AVIF) FAIL
Total image weight under 1 MB OK
No large uncompressed images WARN
Responsive <picture> usage WARN
Images that could be compressed:
https://developer.mozilla.org/en-US/docs/Web/HTML/Guides/Res… — 117.1 KB
https://developer.mozilla.org/en-US/docs/Web/HTML/Guides/Res… — 117.1 KB
Responsive images 70/100
Most images aren't responsive.
Images: 5 · With srcset: 0 · Missing dimensions: 0
Images provide srcset FAIL
Width & height set (prevents layout shift) OK
Offscreen images lazy-load OK
Modern image formats used (WebP/AVIF) WARN
Images to improve:
<img src="picture-element-wide.png">
<img src="non-responsive-narrow.png">
<img src="resolution-example.png">
<img src="picture-element-wide.png">
<img src="picture-element-narrow.png"> How to read the result
- Two parts (0 of 2 areas look good · 64/100)
- Image weight and formats, and responsive markup, each get their own score; the overall score is their average. The sample is MDN's guide to responsive images, chosen because our own pages carry almost no images.
- Images checked (5) · Total image weight (394.7 KB)
- The first 15 <img> elements in the HTML, each asked for its file type and size. Total weight adds up the sizes the servers report; an image sent without a size is not counted, and an image used twice, as one is in the sample, counts twice.
- Modern format (0/5)
- Images served as WebP, AVIF or SVG. SVG counts as fine because it is a vector format: converting a logo or icon to WebP would make it larger and blurry. All five images in the sample are PNG, so the check fails; with some in a modern format it is a warning.
- Est. savings (WebP) (138.1 KB)
- An estimate of the bytes saved by converting each JPEG and PNG to WebP, using a typical saving for each format; no image is converted. Your real figure depends on the image and the quality you choose.
- Images that could be compressed (117.1 KB)
- A JPEG or PNG over 500 KB fails and one over 100 KB is listed here as a warning, like the sample's 117.1 KB screenshot, shown twice because the page uses it twice. The page total warns over 1 MB and fails over 2 MB. The <picture> check warns when fewer than half of the images use a <picture> element, which is advice: srcset alone also lets browsers pick smaller files.
- Responsive images (5 · 0 with srcset · 0 missing dimensions)
- Every <img> in the markup: whether it has srcset or sits in a <picture>, whether it has width and height attributes, and whether offscreen images lazy-load. In the sample every image has its dimensions and lazy-loads, but none has srcset, so the part is red. Its format line looks for .webp or .avif in the addresses rather than asking the server. "Images to improve" lists the files without srcset.
Who Uses This
-
E-commerce Manager
Check category and product pages for images still served as JPEG or PNG at full camera size.
-
Content Manager
Spot uploads that skipped resizing, and pages where images lack srcset or dimensions.
-
Performance Engineer
Estimate how much a WebP conversion would save before choosing an image pipeline.
Common problems and how to fix them
-
Photos served as JPEG or PNG
Serve WebP or AVIF, keeping a JPEG fallback in a <picture> element if you still support very old browsers. Most image CDNs and CMS plugins can convert on upload; keep logos and icons as SVG.
<picture> <source srcset="/img/team.webp" type="image/webp"> <img src="/img/team.jpg" alt="Our support team" width="800" height="420" loading="lazy"> </picture> -
Images over 100 KB
Resize them to the largest size the page shows, then compress at a quality around 75–85. A 4000-pixel photo shown 800 pixels wide is mostly wasted bytes.
-
No srcset on content images
Offer two or three widths in srcset with a sizes attribute, so phones download the small file. Logos, icons and tracking pixels can be left as they are.
<img src="/img/team-800.jpg" srcset="/img/team-400.jpg 400w, /img/team-800.jpg 800w, /img/team-1600.jpg 1600w" sizes="(max-width: 600px) 100vw, 800px" width="800" height="420" alt="Our support team" loading="lazy"> -
Images without width and height
Add width and height attributes with the image's real proportions; CSS can still make it fluid. The browser then reserves the space and the layout does not jump as images arrive.
-
Nothing lazy-loads
Add loading="lazy" to images below the first screen. Leave the main image at the top without it: it is often the Largest Contentful Paint element and should load at once.
Frequently Asked Questions
- How much can I save?
- The report estimates the bytes saved by converting each image that is not in a modern format to WebP. Real savings depend on the image and the quality setting you choose.
- Does compression hurt image quality?
- At sensible quality settings, modern formats look the same to most people. Compare before and after at the size the image is shown.
- What makes an image responsive?
- A `srcset` (or a `<picture>` element) so the browser can pick a smaller file on small screens, plus `width` and `height` so space is reserved before the image loads.
- Should images be lazy-loaded?
- Offscreen images, yes — add `loading="lazy"`. Do not lazy-load the main image at the top of the page; it is often the Largest Contentful Paint element.
- Should I strip EXIF metadata?
- For web display, usually yes — it saves bytes and removes details such as the GPS location.
Sources
The documentation this tool and the explanations on this page are based on.
- Serve images in modern formats — Chrome for Developers
- Using responsive images in HTML — MDN Web Docs
- Optimize Cumulative Layout Shift — web.dev
- Browser-level image lazy loading for the web — web.dev