Skip to content

Toufiq SEO

On-Page SEO

Image SEO: Alt Text, File Names, Formats and Image Sitemaps

How to make images help your rankings and page speed instead of hurting them, following Google's own image guidance.

  • Published
  • 4 min read
Close-up of a camera lens, representing image SEO
On this page
  1. What Google says about images
  2. Alt text
  3. File names
  4. Formats
  5. Size and speed
  6. Use real images
  7. Image sitemaps and discovery
  8. Structured data and images
  9. E-commerce images
  10. A quick image audit
  11. Frequently asked questions

Quick answer: Good image SEO means using real, relevant images placed near related text, descriptive file names, alt text that describes the image for people who cannot see it, modern formats such as WebP or AVIF, correctly sized files with width and height set, lazy loading for images below the fold, and standard HTML image elements that Google can crawl. Image sitemaps help for sites where images matter for discovery.

Images affect SEO in two ways. They can rank on their own in Google Images and image results within search, and they affect page speed, which affects user experience and Core Web Vitals. Most sites lose on both: stock photos with no context and files several times larger than needed.

What Google says about images

Google’s image SEO best practices focus on a few points: use HTML image elements, place images near relevant text, write descriptive alt text and file names, provide high-quality images, and make pages fast and mobile-friendly. Google also notes that it uses the page’s content and title to understand an image.

Alt text

Alt text exists for accessibility first. Screen readers read it aloud, and it appears if the image fails to load. Google uses it too, along with computer vision and surrounding text.

Weak alt textBetter alt text
“image1”“Technician replacing a water heater in a garage”
“roofing roofer roof repair best roofing company”“Asphalt shingle roof after storm damage repair”
“” on an informative chart“Bar chart of monthly organic leads rising from January to June”

Describe what is in the image and why it is there. Use an empty alt attribute for purely decorative images so screen readers skip them. Do not stuff keywords; Google’s guidance warns against it.

File names

Rename files before uploading. water-heater-replacement-garage.jpg tells Google more than IMG_4482.jpg. Use hyphens between words and keep it short.

Formats

  • WebP: widely supported, much smaller than JPEG at similar quality. A safe default.
  • AVIF: often smaller still, with good support in modern browsers.
  • JPEG: fine for photos when properly compressed.
  • PNG: for graphics needing transparency; usually too heavy for photos.
  • SVG: for logos and icons.

Many content management systems and CDNs can serve WebP or AVIF automatically.

Size and speed

  • Resize images to the largest size they display at. A 4,000-pixel photo shown at 800 pixels wastes bandwidth.
  • Use responsive images with srcset so phones get smaller files.
  • Set width and height attributes to prevent layout shift, which affects CLS.
  • Lazy load images below the fold with loading="lazy".
  • Do not lazy load the main hero image. It is often the largest element and lazy loading delays LCP.

My Core Web Vitals guide explains how images affect LCP and CLS.

Use real images

Original photos of your work, team, products and location help in ways stock photos cannot. They show experience, they are unique so they can rank in image search, and they build trust with visitors. For local businesses, the same real photos belong on your Google Business Profile.

Image sitemaps and discovery

Google can find images in standard <img> elements. Images loaded only through CSS backgrounds are not indexed as images. For sites where image search matters, such as e-commerce, photography or recipes, you can add images to your XML sitemap. The XML sitemap guide covers the specifics.

Structured data and images

Product, recipe and article markup can include image properties that help images appear in rich results. Use high-resolution images in several aspect ratios where the documentation recommends it. My schema markup guide covers the main types.

E-commerce images

Product images drive clicks in Google Shopping and image results. Use several angles, a clean main image, and consistent file naming across variants.

A quick image audit

  1. Run your top pages through PageSpeed Insights and note image warnings.
  2. Check alt text on key pages with a crawler.
  3. Look for images over a few hundred kilobytes.
  4. Confirm the hero image is not lazy loaded.
  5. Replace stock images on service pages with real photos where possible.

Image optimization is a standard part of on-page SEO and technical SEO work.

Frequently asked questions

Does alt text help SEO?

Yes, it helps Google understand images and supports accessibility. Write it for people first.

Should every image have alt text?

Every informative image should. Decorative images should have an empty alt attribute.

Is WebP better than JPEG for SEO?

WebP is usually smaller, which helps speed. Google indexes both.

Do stock photos hurt SEO?

Not directly, but they add no unique value and do little for trust. Real images are better.

Sources: Google Search Central: Google image SEO best practices; web.dev: Browser-level image lazy loading.

Toufiq-ur Rahman Kobir
Written by

Independent SEO consultant

Google, Maps and AI search

Toufiq-ur Rahman Kobir is an independent SEO consultant who helps US businesses get found on Google Search, Google Maps and in AI answers. He has led SEO as SEO Manager at a US agency, managing more than twenty webmasters, content managers and copywriters, and now works directly with a small number of clients on technical SEO, local SEO, content strategy and AI search visibility.

Works with
US businesses, remotely
Background
SEO Manager at a US agency
Focus
Technical SEO, content strategy, AI search
Status
Taking on a limited number of clients
Scroll to Top