Audit my site
On-pageIntermediateChecked against official sources · Oct 2026

Image SEO: alt text, formats, responsive sizes and lazy loading

Google understands images through their markup, alt text and the page around them, and users feel them in every load. This lesson covers both halves: getting images found and keeping them fast.

Author: Eugene Serbin, Head of SEO at Semalt Updated: 30 October 2026 Reading time: 18 min Visuals: 5

In short

Image SEO means making your images easy for Google to find, understand and load fast. Put important images in real <img> elements with useful alt text, descriptive file names and relevant text around them. Then serve them in efficient formats at the right size, reserve their space with width and height, and never lazy-load the image people see first.

Where images show up in Google

Images reach searchers in more places than the Images tab. Google lists features “such as the text result images, Google Discover, and Google Images”, and adds: “While each feature and product looks different, the general recommendations for getting images to appear in them is the same.” One set of good habits covers all three.

Images also matter for the page itself. Google notes that “images are often the largest contributor to overall page size, which can make pages slow and expensive to load.” So image SEO has two halves that you cannot separate: helping Google understand the image, and keeping it from slowing the page down.

What Google officially says

“Google doesn't index CSS images.”

Google Search Central — Google image SEO best practices

“The most important attribute when it comes to providing more metadata for an image is the alt text”

Google Search Central — Google image SEO best practices. Google adds: “Google uses alt text along with computer vision algorithms and the contents of the page to understand the subject matter of the image.”

“Don't add lazy-loading to content that is likely to be immediately visible when a user opens a page.”

Google Search Central — Fix lazy-loaded content

Three more statements frame everything below:

Use real img elements, not CSS backgrounds

“Using standard HTML image elements helps crawlers find and process images.” Google reads the src attribute: “Google can find images in src attribute of <img> element (even when it's a child of other elements, such as the <picture> element).” An image set as a CSS background is invisible to Google Images, whatever it shows to users. Google's own pair of examples:

<!-- Good -->
<img src="puppy.jpg" alt="A golden retriever puppy" />

<!-- Bad -->
<div style="background-image:url(puppy.jpg)">A golden retriever puppy</div>

The rule of thumb: if the image carries meaning (a product photo, a chart, a screenshot, a hero photo of the subject), use <img>. If it is pure decoration (a texture, a pattern, a gradient), CSS is the right place for it.

Inline SVG, data URIs and repeated images

Alt text that works

Alt text is read by screen readers, shown when the image fails to load, and used by Google to understand the image. Google's guidance: “When writing alt text, focus on creating useful, information-rich content that uses keywords appropriately and is in context of the content of the page.”

Table · Alt text from bad to best
RatingMarkupWhy
✕ Bad<img src="puppy.jpg"/>Missing alt: no description for screen readers or Google.
✕ Badalt="puppy dog baby dog pup pups puppies doggies …"Keyword stuffing: unreadable and can look like spam.
~ Betteralt="puppy"Correct but generic: says nothing about this puppy.
✓ Bestalt="Dalmatian puppy playing fetch"Specific, natural, describes what the image shows.
✓ Decorativealt=""Empty, not missing: the image adds nothing to the content.
✓ Linked imagealt="Trail running shoes collection"Acts as anchor text, so describe where the link goes.
The first four rows are Google's own examples from its image SEO guide; the last two are standard practice.

How to write it

  1. Describe what the image shows, in the context of this page. The same photo of a kitchen might be alt="Oak kitchen with white quartz worktop" on a product page and alt="Kitchen after the renovation" in a case study.
  2. Keep it to a short phrase or a sentence. Skip “image of” and “picture of”: screen readers already announce that it is an image.
  3. Use the keyword only where it describes the image. A product photo naturally includes the product name, model and colour.
  4. For linked images, describe the destination. Google notes that “alt text in images is useful as anchor text if you decide to use an image as a link.”
  5. Do not copy the caption word for word. Screen reader users would hear the same text twice.

Decorative images: alt="" not a missing alt

For dividers, background flourishes and icons placed next to text that already says the same thing, use an empty alt. MDN explains that alt="" “indicates that this image is not a key part of the content (it's decoration or a tracking pixel)”. A missing alt is different: screen readers may read out the file name instead. If an image is purely decorative and never needs to be in Google Images, CSS is an even cleaner option.

File names, captions and placement

Google calls the file name a minor signal: “the filename can give Google very light clues about the subject matter of the image.” Its example: “my-new-black-kitten.jpg is better than IMG00023.JPG.” And: “Avoid using generic filenames like image1.jpg, pic.gif, 1.jpg when possible.”

The text around the image matters more than the file name. “Google extracts information about the subject matter of the image from the content of the page, including captions and image titles.” Put the image next to the paragraph it illustrates, use a <figcaption> when the image needs explaining, and make sure the page title and headings are about the same subject. A photo of a red shoe on a page about red shoes is easy to understand; the same photo on a generic “Gallery 7” page is not.

Image formats: JPEG, PNG, WebP, AVIF, SVG, GIF

Google Search supports images in “BMP, GIF, JPEG, PNG, WebP, SVG, and AVIF.” It adds: “It's also a good idea to have the extension of your filename match with the file type.” So a file called photo.jpg should really be a JPEG, not a renamed WebP.

Table · Which format for which image
FormatBest forTransparencyAnimationCompressionBrowser support
JPEGPhotos, universal fallbackNoNoLossyUniversal
PNGScreenshots, UI, graphics with sharp edgesYesNo (APNG aside)LosslessUniversal
WebPPhotos and graphics, JPEG/PNG replacementYesYesLossy or losslessAll modern browsers
AVIFPhotos where file size matters mostYesYesLossy or lossless, usually the smallestModern browsers; keep a fallback
SVGLogos, icons, diagramsYesYes (CSS/SMIL)Vector, scales without lossUniversal
GIFLegacy animations only1-bitYesLossless, 256 coloursUniversal
A practical summary: WebP is the safe modern default, AVIF goes smaller with a fallback, SVG covers anything drawn rather than photographed.

WebP vs AVIF: the trade-offs

WebP supports lossy and lossless compression, transparency and animation, and usually produces smaller files than JPEG at similar visual quality. AVIF often goes smaller still, but it is slower to encode, and very aggressive settings can smear fine detail, gradients and text in screenshots, so check the output by eye. Support is the other catch. web.dev puts it this way: “AVIF is brand new, and while support for WebP is excellent across modern browsers, it isn't a given across the entire web.” Serve AVIF and WebP through <picture> with a JPEG or PNG fallback, or let your CDN choose the format based on what the browser accepts.

Compression basics

Responsive images: srcset, sizes and picture

A phone and a 4K monitor should not download the same file. “The srcset attribute allows specifying different versions of the same image, specifically for different screen sizes.” The browser then picks one based on the screen and the layout. Google adds one condition: “However, some browsers and crawlers don't understand these attributes. We recommend that you always specify a fallback URL using the src attribute.”

Code · A complete responsive image

✓ srcset + sizes on one img

<img
  src="/images/red-trail-shoe-960.jpg"
  srcset="/images/red-trail-shoe-480.jpg 480w,
          /images/red-trail-shoe-960.jpg 960w,
          /images/red-trail-shoe-1600.jpg 1600w"
  sizes="(max-width: 600px) 100vw, 50vw"
  width="960" height="640"
  alt="Red trail running shoe, side view">
  • src is the fallback Google asks for
  • sizes describes the layout width
  • width/height reserve space

✓ picture with AVIF and WebP

<picture>
  <source type="image/avif"
    srcset="/images/red-trail-shoe-960.avif">
  <source type="image/webp"
    srcset="/images/red-trail-shoe-960.webp">
  <img src="/images/red-trail-shoe-960.jpg"
    width="960" height="640"
    alt="Red trail running shoe, side view">
</picture>
  • The browser takes the first format it supports
  • The inner <img> keeps src and alt
  • Each <source> can also carry its own srcset/sizes
Both patterns keep a plain src fallback and an alt on the <img>, which is what Google reads.

Inside <picture>, the <img> is not optional: it carries the alt text, the dimensions and the fallback URL. The <source> elements only offer alternatives.

Width, height and layout shift

When the browser does not know an image's size, it lays the page out without it and then pushes the content down once the file arrives. That jump is measured by Cumulative Layout Shift (CLS). The fix is old and simple. web.dev: “As a rule, you should always use height and width attributes on <img>, with values matching the intrinsic size of your image source”, and “By using the width and height attributes on your <img> elements, you'll avoid a high CLS score due to images.”

/* lets the image scale down while keeping its aspect ratio */
img { max-width: 100%; height: auto; }

The attributes give the browser the aspect ratio; the CSS makes the image responsive. With both in place, the space is reserved before the first byte of the image arrives. For CSS-sized containers, aspect-ratio does the same job.

Lazy loading without hiding images

Lazy loading delays offscreen images until the user scrolls near them. It saves bandwidth, but Google warns: “if not implemented correctly, this technique can inadvertently hide content from Google.” Two rules keep it safe.

Rule 1: the image people see first is never lazy. Images matter most for two of the three Core Web Vitals: LCP, INP, CLS. Largest Contentful Paint (LCP) is very often a hero or product image, and lazy-loading it delays the moment the page looks ready. web.dev is blunt: “never specify loading="lazy" on an "above the fold" image”. It also recommends a hint for the main image: “using fetchpriority="high" can inform the browser that the transfer of this image should be prioritized above images elsewhere on the page.”

Rule 2: lazy images must load without user actions. Google needs the implementation to load content “whenever it is visible in the viewport”, and explains why scroll-triggered or click-triggered loading fails: “Google Search does not interact with your page.” Native loading="lazy" and IntersectionObserver both work. A script that only swaps data-src into src after a scroll event does not.

Diagram · Eager above the fold, lazy below it
Which images to load eagerly and which to lazy-load A page split by the fold line. Above the fold, the hero image is the LCP element: load it eagerly with fetchpriority high and no loading lazy. Below the fold, gallery and article images use loading lazy. All images keep width, height and a real src. Hero image usually the LCP element the fold Gallery imageGallery image Article imageArticle image fetchpriority="high" no loading="lazy" real src in the server HTML Load early: it decides LCP loading="lazy" width + height set no scroll or click needed Load later: saves bandwidth
Where exactly the fold sits varies by device, so treat the first one or two content images as above the fold on every template.

Two more practical points. Do not inject the LCP image with JavaScript: it cannot start downloading until the script runs. And test: Google's check is simple, “If your image or video URLs appear in the src attribute on the <img> or <video> elements in the rendered HTML, your setup works correctly.” Use URL Inspection in Search Console to see the rendered HTML. The lessons Core Web Vitals: LCP, INP, CLS and JavaScript SEO and rendering cover both topics in depth.

Image sitemaps

“Image sitemaps are a way of telling Google about other images on your site, especially those that we might not otherwise find (such as images your site reaches with JavaScript code).” They are optional. They help most for large image libraries, galleries loaded by JavaScript and images hosted on a CDN domain. Google is flexible about the setup: “You can create a separate image sitemap or add image sitemap tags to your existing sitemap; either approach is equally fine for Google.”

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
  <url>
    <loc>https://example.com/shoes/red-trail-shoe/</loc>
    <image:image>
      <image:loc>https://cdn.example.com/images/red-trail-shoe-side.webp</image:loc>
    </image:image>
    <image:image>
      <image:loc>https://cdn.example.com/images/red-trail-shoe-sole.webp</image:loc>
    </image:image>
  </url>
</urlset>

General sitemap rules still apply; see the lesson XML sitemaps.

Preferred image, structured data and licensing metadata

Telling Google which image represents the page

“Google's selection of an image preview is completely automated”, but you can state a preference in three ways: the schema.org primaryImageOfPage property, an image property on the page's main entity (for example a BlogPosting), or the og:image meta tag.

<meta property="og:image" content="https://example.com/images/red-trail-shoe-side.jpg">

Google's rules for that preferred image:

Images in rich results

Structured data such as Product, Recipe or Video can earn a badge in Google Images, and “In each of these structured data types, the image attribute is a required field to be eligible for a badge and rich result in Google Images.” The lesson Structured data in 2026 covers the markup itself.

Licensing metadata and the Licensable badge

If you sell or license photos, Google can show who made an image and how to use it: “providing licensing information can make the image eligible for the Licensable badge”. You can supply this in two ways:

<script type="application/ld+json">
{
  "@context": "https://schema.org/",
  "@type": "ImageObject",
  "contentUrl": "https://example.com/photos/red-trail-shoe-side.jpg",
  "license": "https://example.com/license",
  "acquireLicensePage": "https://example.com/how-to-use-our-photos",
  "creditText": "Example Studio"
}
</script>

If both sources exist and disagree, “Google will use the structured data information.”

Removing images from Google Images

Sometimes the goal is the opposite: keeping an image out of search. Google documents three routes for images hosted on your own site.

MethodWhen to use itWatch out for
Removals tool in Search ConsoleUrgent cases: “To quickly remove images hosted on your site from Google's search results, use the Removals tool.”It is temporary: “the images may resurface in Google's search results once the removal request expires.” Add a permanent block as well.
robots.txt for Googlebot-ImagePermanent removal of one image, a folder or a file type, with wildcards.Blocking Googlebot-Image keeps images out of Google Images; to exclude them from all Google results, use the Googlebot user agent.
X-Robots-Tag: noindex on the image responsePermanent removal wherever the image is embedded.“In this case you must allow crawling the image URLs in order for Googlebot to be able to extract the noindex rule.” Do not combine it with a robots.txt block.
User-agent: Googlebot-Image
Disallow: /images/dogs.jpg
Disallow: /private-photos/

A noimageindex robots meta tag on a page stops the images on that page from being indexed through it, but if the same image is embedded on another page it can still be indexed there. The header method is the one that follows the image everywhere. The lesson Meta robots and X-Robots-Tag explains the syntax.

A softer option is to opt out of inline linking: when the image request comes from a Google domain, Google says to “reply with a 200 HTTP status code, or a 204 HTTP status code and no content.” Google then shows only a thumbnail instead of the full-size image, and “This behavior isn't considered image cloaking and won't result in manual actions.”

Check the pages behind your images

OurSEO Tools runs a 69-point checklist, including on-page and rendering & speed, and crawls up to 1,000 pages with status code, indexability and load time per URL.

69-point checklistTechnical crawlContent analysis

Common mistakes

Image SEO checklist

Checklist · Every important image, every template
  • Markupa real <img> with src, inside <picture> if needed; no CSS backgrounds for content
  • Alt textspecific and natural for content images, alt="" for decoration, destination for linked images
  • File nameshort, descriptive, hyphenated, translated on localised pages; extension matches the format
  • Contextnext to relevant text, with a caption where helpful, on a page about the same subject
  • FormatWebP or AVIF with a JPEG/PNG fallback; SVG for logos and icons; video instead of GIF
  • Sizecompressed, exported at display size × pixel density, served via srcset + sizes
  • Stabilitywidth and height set, CSS height: auto
  • LoadingLCP image eager with fetchpriority="high"; the rest loading="lazy" with no scroll trigger
  • Discoverystable image URLs; image sitemap for JS galleries and CDN images; CDN domain verified and not blocked
  • Metadatarepresentative og:image / primaryImageOfPage; image in structured data; licence data if you license photos
  • Verificationimage URLs present in src of the rendered HTML in URL Inspection
Check these per template (product, article, category, home), not per image: one fixed template fixes thousands of images.

FAQ

Does Google index images set as CSS backgrounds?

No. “Google doesn't index CSS images.” Use <img> for any image you want to appear in search.

How long should alt text be?

Long enough to describe what matters in the image for this page, usually a short phrase or one sentence. Google's “best” example is four words: “Dalmatian puppy playing fetch”.

Is WebP or AVIF better for SEO?

Google supports both, so the choice is about speed and quality. AVIF is often smaller; WebP is faster to encode and more widely supported. Many sites serve AVIF first and WebP second through <picture>, with a JPEG fallback.

Does lazy loading hurt image SEO?

Not when done right. Native loading="lazy" on below-the-fold images is fine. Problems come from lazy-loading the LCP image or from scripts that need a scroll or click before the real URL appears in src.

Do I need an image sitemap?

Not if your images are in normal <img> tags on crawlable pages. It is worth adding for very large libraries, JavaScript galleries and images on a CDN domain.

Do image title attributes help?

Google mentions “captions and image titles” among the page content it reads, but alt text is the attribute it calls most important. A title tooltip is never a substitute for alt.

Sources

Quotes checked against the official pages on 30 October 2026.