technical seo 9 min read

How to Optimize Images for SEO: Alt Text, File Names and Page Speed

Images can slow your site down and go completely unnoticed by Google — or they can drive traffic from Google Images and boost your page rankings. Here is how to get it right.

By Vishwas Bhimani · 05 April 2026

Image SEO optimization is one of the most overlooked ways to improve your search rankings. Most site owners spend hours on keywords and backlinks but ignore their images entirely — yet unoptimized images are one of the top causes of slow page load times, poor Core Web Vitals scores, and missed Google Images traffic. This guide covers every step of image SEO optimization from file naming to lazy loading.

Step 1: Use Descriptive File Names

Before you upload an image, rename the file. Google cannot see the image itself — it reads the file name as a signal of what the image contains. A camera-generated file name like IMG_20240312_084523.jpg tells Google absolutely nothing. A descriptive name like keyword-density-checker-results.jpg tells Google exactly what the image shows.

Rules for SEO-friendly image file names:

  • Use lowercase letters only
  • Separate words with hyphens, not underscores or spaces
  • Include your target keyword where it fits naturally
  • Keep it to 3–5 words — concise and descriptive
  • Avoid generic names like "image1.jpg" or "screenshot.png"

Wrong: IMG_20240312_084523.jpg
Right: keyword-density-checker-screenshot.jpg

Step 2: Write Alt Text for Every Image

Alt text (the alt attribute in your <img> tag) serves two critical purposes: it describes images to visually impaired users using screen readers (accessibility), and it tells Google what the image contains (SEO).

According to Google's image SEO guidelines, alt text is one of the most important signals for image ranking. Every image on your page should have a descriptive alt attribute.

Good alt text is:

  • Descriptive and specific — describe what is actually in the image
  • Under 125 characters
  • Natural — do not keyword-stuff it
  • Not prefixed with "image of" or "photo of" — Google already knows it is an image

Wrong: alt="seo seo tips seo guide google seo"
Right: alt="keyword density checker showing 2.3% density for target keyword"

Decorative images (icons, dividers, background patterns) that carry no information should have an empty alt attribute: alt="". This tells screen readers to skip them entirely.

Step 3: Compress Images Before Uploading

Large image files are one of the top causes of slow page load times. A 3MB JPEG that looks visually identical to a 200KB compressed version will cost you rankings — Google's PageSpeed Insights consistently flags oversized images as the single most impactful fix for page speed.

Target file sizes by image type:

  • Hero images: under 200KB
  • Blog inline images: under 100KB
  • Thumbnails and icons: under 20KB

Free compression tools:

  • Squoosh.app — Google's own free image compression tool, excellent quality control
  • TinyPNG / TinyJPG — simple drag-and-drop compression, free up to 20 images/month
  • ImageOptim — Mac desktop app for batch compression

Step 4: Switch to WebP Format

WebP is a modern image format developed by Google that provides superior compression. WebP images are typically 25–35% smaller than JPEG at the same visual quality and 26% smaller than PNG. All major browsers now support WebP, making it the best default format for web images.

When to use each format:

  • WebP — photos, screenshots, complex images (best choice in most cases)
  • SVG — logos, icons, simple graphics (vector, scales without quality loss)
  • PNG — when you need transparency and WebP is not an option
  • JPEG — legacy fallback only

Step 5: Set Image Dimensions in HTML

Always specify the width and height attributes on your <img> tags. This allows the browser to reserve the correct space in the layout before the image loads — preventing Cumulative Layout Shift (CLS), which is one of Google's Core Web Vitals metrics. High CLS scores hurt rankings and user experience.

<img src="keyword-tool.webp" alt="keyword density checker tool interface" width="800" height="450">

Without these attributes, the browser has to download the image to know its size, causing the page layout to shift as images load. This is one of the most common CLS issues on blog pages.

Step 6: Use Lazy Loading

Add loading="lazy" to any image that appears below the fold (below what the user sees on first load). This tells the browser to only load those images when the user scrolls near them — dramatically improving initial page load time and LCP score.

<img src="blog-thumbnail.webp" alt="seo guide thumbnail" width="400" height="250" loading="lazy">

Important: Do not add lazy loading to your hero image or any image visible without scrolling. Those should load immediately for a good LCP score. Only apply lazy loading to images that appear below the fold.

Step 7: Add Images to Your Sitemap

Google can discover images through your page content, but including them in your XML sitemap helps ensure faster indexing and better Google Images visibility. Use the image sitemap extension to list image URLs alongside page URLs:

<url>
  <loc>https://searchranktool.com/keyword-density-checker</loc>
  <image:image>
    <image:loc>https://searchranktool.com/images/keyword-density-tool.webp</image:loc>
    <image:title>Free Keyword Density Checker Tool</image:title>
  </image:image>
</url>

How Image SEO Affects Page Speed and Rankings

Images are typically 50–80% of a page's total file size. Optimizing them alone can reduce page load time by 1–3 seconds on mobile — directly improving your Largest Contentful Paint (LCP) score, which is Google's primary measure of perceived load speed.

Google confirmed in 2021 that Core Web Vitals — including LCP — are official ranking factors. Pages with poor LCP scores are at a disadvantage in search results, especially when competing against pages with similar content quality and authority.

Use our free Readability Checker to analyse your content quality alongside your images, and our Meta Tag Generator to ensure your pages have correctly optimized title tags before publishing.

Ranking in Google Images Search

Google Images is a separate search engine within Google that drives significant traffic — often overlooked by site owners. To rank in Google Images:

  • Use descriptive, keyword-rich file names
  • Write detailed alt text that matches what users search for
  • Ensure the surrounding page content is relevant to the image topic
  • Use structured data (schema markup) for images where applicable
  • Ensure your page loads quickly — Google Images prioritises fast-loading pages

For an SEO tools site, ranking in Google Images for screenshots and infographics of tool results can drive meaningful additional traffic from users searching for visual comparisons.

Complete Image SEO Checklist

  • File name is descriptive, lowercase, hyphenated, includes keyword
  • Alt text is descriptive, under 125 characters, no keyword stuffing
  • Decorative images have empty alt="" attribute
  • Images compressed to target file size (WebP preferred)
  • Width and height attributes set on all img tags
  • Below-fold images use loading="lazy"
  • Hero/above-fold image has no lazy loading
  • Images included in XML sitemap
  • Page LCP score under 2.5 seconds (check with PageSpeed Insights)

Image Structured Data: Getting Into Google Discover and Image Search

For content sites that rely heavily on images, structured data can unlock additional visibility beyond standard organic search. Two schema types are particularly relevant:

ImageObject schema provides Google with explicit metadata about images — including the image URL, caption, license information and creator. For editorial and news content, this schema helps images appear with rich metadata in Google Image Search and Google Discover. Include the properties: url, name, description, caption, width and height.

Article schema with image — when your Article or BlogPosting schema includes an image property pointing to a high-quality image (at least 1200 × 628 pixels), this image can appear in Google News and Google Discover alongside your article. Google recommends a 16:9 aspect ratio for best results. Pages with a properly specified Article image see significantly higher click-through rates from Google Discover compared to pages without it.

For your image to be eligible for Google Discover it must be at least 1200px wide, must not be blocked in robots.txt, and must be a non-promotional image that adds genuine value to the content. Use Google's Rich Results Test to validate your image schema and verify eligibility for rich features.

Frequently Asked Questions

Does alt text directly affect Google search rankings?

Alt text is a confirmed on-page SEO signal. Google uses it to understand image content for both regular search results and Google Images. Pages with missing or poor alt text are missing a ranking signal. However, it is not as impactful as title tags, content quality, or backlinks.

What is the best image format for SEO?

WebP is the best format for most web images in 2026. It provides smaller file sizes than JPEG and PNG at equivalent quality, which improves page speed — a confirmed ranking factor. SVG is best for logos and icons.

How much does image compression affect page speed?

Significantly. Images account for 50–80% of most pages' total file size. Compressing images properly can reduce page load time by 1–3 seconds on mobile, which directly improves your Core Web Vitals scores and search rankings.

Should I use lazy loading on all images?

No. Only use lazy loading on images that appear below the fold (not visible on first load). Your hero image and any images visible without scrolling should load immediately. Lazy loading the hero image will hurt your LCP score.

How do I check if my images are hurting my page speed?

Run your URL through Google PageSpeed Insights (pagespeed.web.dev). It will show you exactly which images are oversized, uncompressed, or missing modern formats — with specific file size recommendations for each.

Put This Into Practice

Use our free SEO tools to apply what you just read. No signup required.

V

Vishwas Bhimani

Vishwas Bhimani is a web developer and digital entrepreneur from India. He builds websites, mobile apps, and online tools — and created SearchRankTool to make professional SEO analysis free and accessible for everyone.

Back to Blog