Image SEO: formats, sizes and alt text that actually matter

Use real img tags, modern formats at display size, descriptive alt text and file names, and never lazy-load the hero image. What matters and what does not.

By Sohail Hussain21 November 20265 min read

Image SEO comes down to five things: put images in real <img> elements Google can find, serve them in a modern format (WebP or AVIF) at roughly the size they are displayed, set width and height so the layout does not jump, write alt text that describes the image in context, and never lazy-load the main image at the top of the page. Get those right and you have done most of what matters, for Google Images and for page speed.

Images are usually the heaviest part of a business website, so this is as much a speed job as a search job. It is one of the speed checks in our technical SEO checklist, and image weight is one of the first things we measure in technical SEO and performance work.

How does Google find and index images?

Google's image SEO best practices set out the basics:

  • Use HTML image elements. Google finds images in the src attribute of <img>, including an <img> inside a <picture> element. It does not index images set as CSS backgrounds. A hero photo applied with background-image is invisible to image search.
  • Use a supported format. Google Search supports BMP, GIF, JPEG, PNG, WebP, SVG and AVIF. Keep the file extension matching the real file type.
  • Always give a src fallback. Some crawlers do not read srcset or <picture>, so the plain src must point to a real image.
  • Reference each image by one consistent URL. If the same image appears on many pages, use the same URL everywhere so Google can cache it rather than fetch copies.
  • Make the landing page relevant. Google uses the page's text, captions and title to understand an image. An image placed near text about the same subject is easier to rank than one in a generic gallery.

An image sitemap helps only when images would otherwise be missed. Unlike a normal sitemap, image sitemap entries can point to another domain, which is useful when images live on a CDN.

Which format should you use?

FormatBest forNotes, as of October 2026
WebPThe default for photos and most graphicsSupported by all current major browsers; much smaller than JPEG at similar quality
AVIFPhotos where the smallest file mattersSupported by all current major browsers; smaller again, slower to encode
JPEGPhotos where WebP or AVIF are not availableUniversal fallback
PNGScreenshots and graphics with sharp edges or transparencyLarge for photos; convert photos to WebP
SVGLogos, icons, simple illustrationsScales to any size; for inline SVG, use a <title> element as the text alternative
GIFAvoidUse a short muted video for animation; it is far smaller

You rarely need to convert by hand. The Next.js image component serves WebP by default and AVIF once it is enabled in the config, and most WordPress hosts and image plugins can do something similar. For one-off files, our image compressor shrinks JPG, PNG and WebP in the browser without uploading anything, and the WebP converter handles format changes.

How large should images be?

As large as they are displayed, times the screen's pixel density, and no larger. A photo shown 600 pixels wide in a content column needs a file about 1,200 pixels wide for sharp display on high-density phones. Uploading the 4,000-pixel original from a camera sends ten times the data for no visible gain.

Use srcset and sizes so the browser picks the right file for the screen:

html
<img
  src="/images/kitchen-renovation-1200.webp"
  srcset="/images/kitchen-renovation-640.webp 640w,
          /images/kitchen-renovation-1200.webp 1200w,
          /images/kitchen-renovation-1920.webp 1920w"
  sizes="(max-width: 768px) 100vw, 50vw"
  width="1200"
  height="800"
  alt="Renovated kitchen with oak cabinets and a white quartz worktop"
  loading="lazy"
  decoding="async"
/>

Three attributes in that snippet matter for Core Web Vitals:

  • width and height let the browser reserve the space before the image arrives, which prevents layout shift (CLS).
  • loading="lazy" delays images below the fold until the visitor scrolls near them. Use it on everything except the first screen.
  • Never lazy-load the hero. The large image at the top is usually the page's Largest Contentful Paint element. Load it normally and add fetchpriority="high" so the browser fetches it first.

As a working guide, a full-width hero rarely needs to exceed 150 to 250 KB in WebP or AVIF, and content images far less. Page speed vs Core Web Vitals explains how image weight shows up in the metrics Google uses.

How do you write alt text and file names that help?

Google calls alt text the most important attribute for image metadata. It uses alt text together with computer vision and the page content to understand an image, and it uses the alt text of a linked image as that link's anchor text.

Good alt text describes what the image shows, in the context of the page, in one sentence. Google's own example ranks the options: no alt is bad, a list of keywords is bad, "puppy" is better, and "Dalmatian puppy playing fetch" is best.

  • Describe, do not label. "Team photo" says little. "Our five site engineers at the Wakad project handover" says what a reader would see.
  • Leave decorative images empty. Dividers, background textures and icons next to text get alt="", so screen readers skip them.
  • Do not stuff keywords. Google warns that keyword-filled alt text is a poor experience and can be treated as spam.

File names give Google what it calls "very light clues". Use short, descriptive, hyphenated names, such as kitchen-renovation-pune.webp rather than IMG_4032.jpg, and translate them on localized pages. It is a small gain, so do it for new uploads rather than renaming an existing library, which breaks image URLs.

Which image represents your page in search results and shares?

Google chooses a preview image for each page automatically, but you can state a preference. Google's documentation lists three ways: the schema.org primaryImageOfPage property, an image on the page's main entity (for example in Article markup), or the og:image meta tag. Since March 2026 its documentation confirms it uses both schema.org markup and og:image as sources.

Choose an image that represents the page, at high resolution, without extreme proportions. Google advises against using your logo or an image full of text. The same og:image is what LinkedIn, WhatsApp and Facebook show when the page is shared, so it earns its place twice. Our Open Graph generator builds the tags.

What is not worth your time?

  • Renaming thousands of existing files for keywords. The gain is small and the broken image URLs cost more.
  • Chasing Google Images traffic for a service business. For most firms that sell services, image search sends few enquiries. The main return on image work is a faster site.
  • Compressing until photos look poor. Google's documentation notes that sharp, high-quality images are more appealing in results. A visibly blocky hero costs more trust than the kilobytes save.

If your site runs on Next.js, much of this is automatic; Next.js for SEO covers what the image component does and does not do for you.

Was this guide useful?

Questions

Frequently asked.

Should I use WebP or AVIF?

Either, as of October 2026, since all current major browsers support both. AVIF usually produces smaller files for photos but is slower to encode; WebP is quicker to produce and well supported by every CMS. Many sites serve AVIF with a WebP or JPEG fallback through the picture element or their image service.

Does alt text help rankings?

It helps Google understand what an image shows, which matters for image search and for images used as links, where alt text acts as anchor text. Its main job is accessibility for people using screen readers. Write it for them, describe the image in context, and do not stuff keywords.

Do I need an image sitemap?

Usually not. If your images sit in normal img tags on crawlable pages, Google finds them. An image sitemap helps when images load in ways Google might miss, or live on a CDN domain, since image sitemap entries may point to other domains.

Sohail Hussain

Founder, MSH Technologies

Sohail has designed and built websites, web apps and AI products for over 12 years, for clients from Singapore-based industrial groups to early-stage SaaS startups. He writes about what actually worked.

Keep reading

Related guides.

All posts

Your next move

Like what you see? Tell us about it.

A process that takes too long, a website that undersells you, or an idea ready to take shape. Tell us where you are and we will suggest a useful next step.

India · Working with clients worldwide

Sohail, Founder, replies within 1 working day (Mon–Sat, IST). Free and no obligation.