Image SEO has two goals: help Google find and understand your images, and keep pages fast enough that images do not hurt Core Web Vitals. This guide follows Google Search Central and web.dev guidance, and includes a small responsive-image example with measured file sizes.
Why images matter for search and speed
Google uses images in two ways that matter here:
- Understanding and ranking images. Google "extracts information about the subject matter of the image from the content of the page", including captions and image titles, and uses alt text, file names and the surrounding text (Google Search Central).
- Page experience. Google notes that "images are often the largest contributor to overall page size, which can make pages slow and expensive to load."
The Core Web Vitals and their "good" thresholds, measured at the 75th percentile of page loads (web.dev):
| Metric | Measures | Good | How images affect it |
|---|---|---|---|
| Largest Contentful Paint (LCP) | Loading | 2.5 s or less | The LCP element is very often an image |
| Interaction to Next Paint (INP) | Responsiveness | 200 ms or less | Mostly JavaScript; heavy image galleries and sliders can add main-thread work |
| Cumulative Layout Shift (CLS) | Visual stability | 0.1 or less | Images without reserved space push content down |
How often is the LCP element an image? The HTTP Archive Web Almanac 2025 found an image LCP element on "85.3% of desktop pages and 76% of mobile pages" (measurements from July 2025, Web Almanac 2025).
1. Use short, descriptive file names
Google's example: "my-new-black-kitten.jpg is better than IMG00023.JPG", and it suggests "filenames that are short, but descriptive." Practical habits:
- Lowercase words separated by hyphens.
- Name what is in the image, not your keyword list.
- Rename before upload; many CMSs build the URL from the file name.
2. Write alt text that describes the image
Google calls alt text "the most important attribute when it comes to providing more metadata for an image", and warns: "Avoid filling alt attributes with keywords." Its own examples:
| Quality | Example |
|---|---|
| Bad (missing) | <img src="puppy.jpg"/> |
| Bad (keyword stuffing) | alt="puppy dog baby dog pup pups puppies doggies pups litter puppies dog retriever..." |
| Better | alt="puppy" |
| Best | alt="Dalmatian puppy playing fetch" |
Alt text is also what screen-reader users hear, so write for them first. Purely decorative images can use an empty alt="" so assistive technology skips them.
Place images near the text they illustrate. Google advises: "make sure images are placed near relevant text".
3. Resize to the sizes you actually display
The biggest saving usually comes from not shipping pixels nobody sees. A 4000-pixel-wide phone photo shown in an 800-pixel column wastes most of its bytes. Export a few widths that match your layout and let the browser choose (step 5). You can do this with Resize, with the free batch tool (up to 100 images per run, processed in your browser and downloaded as one ZIP), or with an image CDN or build step that generates widths automatically.
4. Compress and pick the right format
- Photos: WebP or AVIF, with JPEG as a fallback. Google Search supports "BMP, GIF, JPEG, PNG, WebP, SVG, and AVIF" images.
- Screenshots, diagrams and line art: PNG or lossless WebP.
- Logos and icons: SVG where you have a vector version.
Our image format comparison has a reproducible size test, and the compression guide explains lossy versus lossless settings.
There is no official file-size limit for SEO. As an ImageWand suggestion, aim for the smallest file that still looks right at its displayed size, and check large hero images first because they usually affect LCP. Google also notes that "High-quality photos appeal to users more than blurry, unclear images", so do not compress until the image looks damaged.
5. Responsive markup: srcset, sizes, width and height
A tested example. We generated one 1600 x 1000 synthetic landscape image (the code-generated test image from our format comparison, not a real photo) and exported three widths with sharp 0.34.5 (libvips 8.17.3) on 23 November 2026:
// resize uses sharp's default lanczos3 kernel
for (const w of [400, 800, 1200]) {
await sharp(master).resize({ width: w }).jpeg({ quality: 80, mozjpeg: true }).toFile(`hills-${w}.jpg`)
await sharp(master).resize({ width: w }).webp({ quality: 80 }).toFile(`hills-${w}.webp`)
}
| Width x height | JPEG q80 (mozjpeg) | WebP q80 |
|---|---|---|
| 400 x 250 | 7,398 bytes | 4,510 bytes |
| 800 x 500 | 22,028 bytes | 14,226 bytes |
| 1200 x 750 | 39,346 bytes | 24,560 bytes |
| 1600 x 1000 (full size) | 63,736 bytes | 38,940 bytes |
| 1600 x 1000 lossless PNG master | 2,047,981 bytes |

The markup, for an image that fills the screen on phones and an 800-pixel column on wider screens:
<picture>
<source type="image/webp" sizes="(max-width: 840px) 100vw, 800px"
srcset="hills-400.webp 400w, hills-800.webp 800w, hills-1200.webp 1200w">
<img src="hills-800.jpg" sizes="(max-width: 840px) 100vw, 800px"
srcset="hills-400.jpg 400w, hills-800.jpg 800w, hills-1200.jpg 1200w"
width="1200" height="750" fetchpriority="high"
alt="Green hills under a blue sky with a low sun">
</picture>
How it works, per MDN:
srcsetlists the files and their intrinsic widths (400wmeans 400 pixels wide).sizestells the browser how wide the image slot will be. The first matching media condition wins; the last value (800px) is the default.- The browser considers screen size, pixel density, zoom and network speed, then loads a candidate at least as large as it needs. If none matches exactly, it picks the next larger one and scales it down.
srcis the fallback. Google recommends you "always specify a fallback URL using thesrcattribute", because some browsers and crawlers ignoresrcsetandpicture.widthandheightlet the browser reserve space before the image loads, which prevents layout shift (web.dev, CLS). All candidates must share the same aspect ratio (here 16:10). Pair it with CSS such asimg { width: 100%; height: auto; }.
What a WebP-capable browser would typically download with this markup (the exact choice is up to the browser):
| Visitor | Slot needed | File chosen | Bytes |
|---|---|---|---|
| Desktop, 1x screen | 800 px | hills-800.webp | 14,226 |
| Phone 390 px wide, 2x screen | about 780 px | hills-800.webp | 14,226 |
| Phone 390 px wide, 3x screen | about 1170 px | hills-1200.webp | 24,560 |
| Without srcset, full-size JPEG | 1600 px JPEG | 63,736 | |
| Uploading the lossless master | 1600 px PNG | 2,047,981 |
For this test image, the 1x desktop visitor downloads less than a quarter of the bytes of the single full-size JPEG, and well under 1% of the PNG master. These numbers come from sharp/libvips on one synthetic image, not from ImageWand's in-browser tools; real photos with more fine detail will be larger. Download the outputs to compare: hills-400.jpg, hills-400.webp, hills-1200.jpg, hills-800.webp, hills-1200.webp.
6. Lazy loading versus LCP priority
Native lazy loading is one attribute and "well supported across all the major browsers" (web.dev):
<img src="gallery-3.jpg" loading="lazy" width="800" height="500" alt="...">
Use it for images further down the page, and do not use it for the hero:
- web.dev: "Don't lazy-load images that are likely to be in-viewport when the page loads, especially LCP images."
- web.dev on LCP: "Never lazy-load your LCP image, as that will always lead to unnecessary resource load delay." Instead, "set
fetchpriority="high"" on that image, and on no more than one or two images (Optimize LCP). - If the LCP image is only referenced from CSS or JavaScript, preload it so the browser discovers it early.
This mistake is common: the Web Almanac 2025 reports that "about 16%-17% of pages lazy-load their LCP image."
For SEO, Google lists browser built-in lazy loading as a supported method for images, as long as content loads "whenever it is visible in the viewport" and does not depend on clicks or scrolling, because "Google Search does not interact with your page" (Google Search Central). Also use real img elements for content images: "Google doesn't index CSS images."
7. Deliver images efficiently
An image CDN (for example Cloudflare Images, Cloudinary, Imgix or ImageKit) can resize, convert and cache images on request, which saves you from generating every width by hand. Google allows image sitemap entries on other domains, "which lets you use CDNs to host images". Whatever you use, check that it serves correct Cache-Control headers and keeps the aspect ratio consistent across widths.
8. Image sitemaps
An image sitemap helps Google discover images it might otherwise miss. Google's current format needs only two tags (Image sitemaps):
<url>
<loc>https://example.com/page.html</loc>
<image:image>
<image:loc>https://example.com/pic.jpg</image:loc>
</image:image>
</url>
Google has removed image:caption, image:title, image:geo_location and image:license from its documentation, so you do not need them. Each url can list up to 1,000 images. Declare the xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" namespace on the urlset.
9. Structured data
Structured data can make a page eligible for rich results and badges in Google Images, and Google notes that "the image attribute is a required field to be eligible for a badge and rich result in Google Images". Point it at crawlable image URLs:
{ "@context": "https://schema.org", "@type": "Product", "name": "Trail running shoe",
"image": ["https://example.com/photos/shoe-front.jpg", "https://example.com/photos/shoe-side.jpg"] }
Follow Google's guidelines for the specific type (Product, Recipe, Article and so on); structured data does not guarantee a rich result.
10. Measure
- PageSpeed Insights / Lighthouse: shows LCP, CLS and INP, which element is the LCP element, and oversized or unprioritised images.
- Search Console: Core Web Vitals report for field data, and URL Inspection to see whether Google rendered your images.
- Real devices: check that images look sharp on high-density phone screens and that the hero appears quickly on a throttled connection.
Common mistakes
- Uploading camera originals and scaling them down with CSS.
- Lazy-loading the hero image.
- Missing
widthandheight(or CSSaspect-ratio) on images, causing layout shift. - Keyword-stuffed alt text, or no alt text on meaningful images.
- Content images added as CSS backgrounds, which Google does not index.
srcsetcandidates with different aspect ratios.
Checklist
- Descriptive, hyphenated file names
- Specific alt text on every meaningful image; empty alt on decorative ones
- Images resized to the widths you display, in a modern format with a fallback
srcset,sizes,srcfallback,widthandheightfetchpriority="high"on the LCP image;loading="lazy"only below the fold- Images placed near relevant text
- Image sitemap with
image:locif images are hard to discover - LCP, CLS and INP checked in PageSpeed Insights or Search Console
Related reading
- Best image formats for the web: JPEG, PNG, WebP and AVIF with a reproducible size test.
- Compress images without losing quality: lossy versus lossless, with a benchmark.
- Resize images without losing quality: how downscaling and enlargement actually work.
- HEIC to JPG: getting iPhone photos into a web-friendly format first.


