Skip to content

How to Optimize Images for SEO – Complete Guide

Improve your search rankings with properly optimized images. Format selection, compression, alt text, lazy loading, and more.

Updated PixelConvertor

Quick Answer

To optimize images for SEO, use a modern format (WebP/AVIF), compress each image to the smallest file size at acceptable quality, and resize it to its display dimensions. Then write descriptive alt text and file names, and lazy-load images below the fold. These steps improve Core Web Vitals and help images rank in search.

Step 1: Choose the Right Format

Modern formats compress best:

  • AVIF gives the smallest files and the best Core Web Vitals scores
  • WebP compresses well and has broad browser support
  • JPG is a safe fallback and suits photographs
  • PNG is only for graphics that need transparency or sharp text

If you're not sure which format suits a particular image, use the format advisor.

Step 2: Compress Without Visible Quality Loss

Compress each image to the smallest file size that still looks right. For photographs, JPG or WebP quality 80-85 is a good balance. For graphics, use lossless compression. Aim for these targets:

  • Hero images: under 200 KB
  • Content images: under 100 KB
  • Thumbnails: under 30 KB

Step 3: Resize to Display Dimensions

Never serve images larger than they appear on screen. Use responsive srcset attributes to serve a suitable size for each device. A common pattern is to create 3 sizes (small, medium, large) and let the browser choose.

Step 4: Write Descriptive Alt Text

Alt text makes images accessible to visually impaired users and gives search engines context. Write specific, descriptive alt text for every meaningful image. Purely decorative images should have an empty alt attribute.

Step 5: Use Descriptive File Names

Rename files from generic names like IMG_20240315.jpg to descriptive names like golden-retriever-park-frisbee.jpg. File names are a minor ranking signal and help Google understand what the image shows.

Step 6: Implement Lazy Loading

Add loading="lazy" to images below the fold. The browser then waits to load them until the user scrolls near them, which reduces the initial page weight and improves Largest Contentful Paint (LCP). Don't lazy-load images above the fold, because they should load immediately.

SEO Image Checklist

OptimizationImpactEffort
Convert to WebP/AVIFHigh (file size)Low
Compress at Q80-85High (file size)Low
Resize to display sizeHigh (file size)Medium
Descriptive alt textMedium (relevance)Medium
Lazy loadingMedium (LCP)Low
Descriptive file namesLow (ranking signal)Low
Structured data (ImageObject)Low (rich results)Medium

Try It Now

Optimize your images for SEO in your browser, with no software to install and no uploads to a server.

Optimize Your Images

Frequently Asked Questions

Does image optimization affect SEO rankings?

Yes, directly and indirectly. Image optimization improves page load speed, which is a Google ranking factor (Core Web Vitals). Properly optimized images with descriptive alt text help Google understand your page content and can appear in Google Image search results.

What is the best image format for SEO?

WebP and AVIF are the best formats for SEO because they offer the smallest file sizes with excellent quality. Serve them with JPG or PNG fallbacks for older browsers. Use AVIF where browser support allows for the maximum SEO benefit from fast loading.

How do I write good alt text for SEO?

Write alt text that describes the image content specifically and concisely. Good: 'Golden retriever catching a frisbee in a park.' Bad: 'image1.jpg' or 'dog photo.' Include relevant keywords naturally, but don't keyword-stuff. Alt text should serve users who can't see the image.

What size should images be for a website?

Website images should match their display size. For most websites, content images should be 800-1200 pixels wide, hero images 1600-2000 pixels wide, and thumbnails 200-400 pixels wide. Serving images larger than their display size wastes bandwidth and slows page loading.