Images are one of the most neglected areas of on-page SEO. Most site owners spend time on title tags, meta descriptions, and heading structure while leaving their images with names like IMG_4821.jpg, no alt text, and file sizes that add seconds to page load time. Each of those is a missed opportunity, and at scale across a site with hundreds of images, the cumulative impact on both rankings and page speed is significant.
Image optimization has two distinct SEO payoffs. First, properly named and tagged images can rank in Google Image Search, which is a real additional traffic channel for many niches. Second, correctly compressed and formatted images directly improve page speed and Core Web Vitals scores, which are confirmed ranking signals for all search results. This guide covers both dimensions completely.
Alt Text: The Most Important Image SEO Element
Alt text (the alt attribute on an <img> tag) serves two purposes simultaneously. For accessibility, it's what screen readers announce to visually impaired users when they encounter an image. For SEO, it's the primary way Google understands what an image depicts, because Google's computer vision is good but not perfect, and alt text provides an explicit, authoritative label.
How to Write Effective Alt Text
Good alt text describes the image specifically and accurately, includes the target keyword where it fits naturally, and is concise. The sweet spot is typically 8 to 15 words: enough to be descriptive, not so long that it becomes a keyword-stuffed paragraph.
For a photograph of a person using a laptop at a desk to illustrate a guide on SEO audits, a well-written alt text might be: "person running an SEO audit using a laptop at a desk." That's specific, includes a relevant keyword, and would be genuinely useful to a screen reader user who can't see the image.
What to avoid: leaving alt text blank on meaningful images (acceptable only for purely decorative images that add no informational value), stuffing multiple keywords into a single alt tag ("SEO audit free SEO audit tool technical SEO audit checklist"), or writing generic descriptions ("image of a laptop") that don't communicate what's actually in the image or its relevance to the surrounding content.
Decorative images, such as background gradients, decorative dividers, or icon sprites that convey no specific information, should use an empty alt attribute (alt="") rather than no alt attribute at all. An empty alt tells screen readers to skip the image. A missing alt attribute leaves the behavior undefined and often causes screen readers to read out the file name instead, which is a poor experience for accessibility and a signal Google's quality systems can notice.
File Names: The First Signal Google Reads
Before Google can read an image's alt text, its crawler has to request the image file. The file name in that URL is the first signal Google reads about the image's content. A file named how-to-write-alt-text-for-seo.jpg tells Google something useful before any other signal is processed. A file named IMG_4821.jpg tells Google nothing.
The rules for SEO-friendly image file names are straightforward. Use lowercase letters, separate words with hyphens rather than underscores or spaces, include the primary keyword where it fits naturally, and keep the name descriptive but not excessively long. Five to eight words is usually the right range.
Rename images before uploading them. Renaming after upload means existing URLs change, which breaks any inbound links to the image and requires redirects to preserve those signals. Building the habit of naming images correctly at the point of creation takes almost no additional time and pays dividends every time that image is indexed or linked.
Image Compression: The Page Speed Connection
Images are consistently the largest contributors to page weight on most websites. A single uncompressed JPEG from a modern smartphone camera can be 5-8MB. At that size, even one image on a page will significantly delay load time, increasing Largest Contentful Paint (LCP), pushing Core Web Vitals scores into the "needs improvement" or "poor" range, and suppressing rankings as a direct result.
The goal of image compression is to reduce file size to the minimum that preserves acceptable visual quality for the display size the image actually renders at. There's no benefit to serving a 4000-pixel-wide image to a column that's 800 pixels wide. The extra resolution adds file size with zero visual benefit.
Compression Targets by Image Type
JPEG is best for photographs and complex images with many colors and gradients. A quality setting of 70-80% in most compression tools produces visually indistinguishable results from the original at a fraction of the file size. Target under 150KB for most blog images and under 300KB for full-width hero images.
PNG is best for images with transparency, text, or sharp edges (logos, screenshots, diagrams). PNG compression is lossless, so quality isn't a variable, but tools like pngquant can reduce PNG file sizes by 40-60% without visible degradation by reducing the color palette.
WebP is Google's modern format that consistently produces 25-35% smaller files than JPEG or PNG at equivalent visual quality. Browser support is now essentially universal. Serving WebP instead of JPEG or PNG is one of the single highest-impact image optimizations available, and it's a recommendation that shows up regularly in Page Speed Optimizer reports.
AVIF is the next-generation format after WebP, offering even better compression ratios. Browser support is strong in 2026 but not quite universal, so serving AVIF with a WebP or JPEG fallback via the HTML <picture> element is the current best practice for maximum compression with full compatibility.
Responsive Images and the width and height Attributes
Serving the same large image to mobile and desktop users wastes bandwidth on mobile devices and contributes to poor mobile Core Web Vitals scores. The HTML srcset attribute lets you specify multiple image sizes and let the browser choose the appropriate one based on the viewport width. Implementing srcset for your key images ensures mobile users download an appropriately sized image rather than downloading a desktop-sized image and scaling it down in CSS.
Always include explicit width and height attributes on <img> tags. When these attributes are present, the browser can reserve the correct space for the image before it loads, preventing the layout shift that contributes to Cumulative Layout Shift (CLS) scores. CLS is a Core Web Vitals metric and a confirmed ranking signal. Missing width and height attributes are one of the most common and easiest-to-fix sources of CLS problems. Check your pages' CLS and other Core Web Vitals scores with the Page Speed Optimizer, which pulls real Lighthouse data via Google's API.
Lazy Loading
Lazy loading delays the loading of images that are below the visible viewport (below the fold) until the user scrolls toward them. This reduces the initial page load time and lowers the total data transferred on pages where many images are present but most won't be seen on a typical visit. Adding loading="lazy" to <img> tags is now natively supported in all modern browsers and requires no JavaScript.
One important exception: never lazy load the LCP image, which is typically the largest image visible in the initial viewport, often a hero image or the first large article image. Lazy loading the LCP image delays its rendering and directly worsens your LCP score. Apply lazy loading to all below-the-fold images but leave above-the-fold images to load eagerly (which is the default browser behavior).
Image Sitemaps
Google can discover images through crawling page content, but an image sitemap gives you explicit control over which images you want indexed and provides additional metadata. Image sitemaps use the standard XML sitemap format with image-specific extensions, listing the image URL, caption, title, and geographic location where relevant.
For most sites, images embedded in standard HTML <img> tags on indexable pages will be discovered through regular crawling without a dedicated image sitemap. Image sitemaps become more valuable when you have a large image library, when important images are loaded via JavaScript (which can delay their discovery), or when you want to provide caption and title data that isn't present in the page HTML. Validate your XML sitemap structure with the XML Sitemap Validator if you choose to implement one.
Structured Data for Images
For certain content types, adding structured data that references your images can improve how Google displays them in search results. Article schema should include an image property pointing to a high-quality representative image (minimum 1200px wide for maximum Google News and Discover eligibility). Product schema includes image properties that can appear in product rich results. Recipe schema images appear in the recipe carousel.
The Schema Markup Generator builds valid JSON-LD for all of these types, and the Schema & Structured Data Tester validates existing schema to confirm your image references are formatted correctly.
A Practical Image SEO Checklist
Before uploading: rename the file descriptively with hyphens, compress to the target file size for the format, and convert to WebP where possible.
In the HTML: write specific, keyword-natural alt text; add explicit width and height attributes; add loading="lazy" to below-the-fold images; implement srcset for images that display at variable widths.
For the page overall: check that no single image is the dominant page weight cause using the Page Speed Optimizer, which identifies the specific images contributing most to load time and recommends the exact optimizations that will have the biggest impact.
Image SEO doesn't require complex tooling. The fundamentals, good file names, descriptive alt text, compressed files, proper HTML attributes, are all things you control directly at zero cost. Done consistently, they compound across every image on your site into meaningful improvements in both page speed scores and search visibility.