Image SEO: Alt Text, File Names, Formats and File Size
Good image SEO helps your pictures appear in image search and keeps pages fast. Here is how to handle alt text, file names, formats, sizing and lazy loading.

Image SEO means making your images understandable to search engines and fast for visitors: descriptive alt text, clear file names, a modern format such as WebP or AVIF, and files sized to the space they actually fill. Done well, it helps images appear in Google Images and keeps them from dragging down Core Web Vitals such as Largest Contentful Paint (LCP) and Cumulative Layout Shift (CLS).
Key takeaways
- Alt text is for people using screen readers first; useful alt text also gives search engines context.
- Use descriptive, hyphenated file names instead of
IMG_4821.jpg. - Serve WebP or AVIF where possible, at the dimensions the layout needs, and compress them.
- Set width and height, lazy-load below-the-fold images, and never lazy-load the main hero image.
Write alt text that actually describes the image
The alt attribute provides a text alternative for an image. Screen readers read it aloud, browsers show it if the image fails to load, and search engines use it, together with surrounding text, to understand what the image shows.
Good vs bad alt text
| Image | Weak alt text | Better alt text |
|---|---|---|
| Product photo | shoe | Blue lightweight trail running shoe, side view |
| Team photo | image of team best SEO agency | Five members of the support team standing outside the Denver office |
| Chart | chart | Bar chart of monthly visits, rising from January to June |
| Logo linking home | logo.png | Example Co home page |
Some practical rules:
- Describe what matters in context. The same photo of a kitchen might be described by its layout on a renovation page and by its countertop material on a stone supplier's page.
- Skip "image of" and "picture of". Screen readers already announce that it is an image.
- Linked images need alt text that describes the destination, because the alt acts as the link text.
- Decorative images get an empty alt:
alt="". This tells screen readers to skip them. Leaving the attribute out entirely is different and can cause some readers to announce the file name. - Do not stuff keywords. If the keyword describes the image, it will fit naturally.
<!-- Meaningful image -->
<img src="/images/blue-trail-running-shoe.webp"
alt="Blue lightweight trail running shoe, side view"
width="800" height="600">
<!-- Decorative divider -->
<img src="/images/wave-divider.svg" alt="">
Use descriptive file names
Google has said file names can give it light clues about an image's subject. More importantly, a clear name makes your media library manageable. Compare DSC_0042.jpg with oak-dining-table-6-seater.jpg.
- Use lowercase words separated by hyphens, not underscores or spaces.
- Keep it short and specific: three to six words is usually enough.
- Rename before uploading, because many CMSs bake the file name into the URL and changing it later breaks links.
- Avoid non-ASCII characters and spaces, which get percent-encoded into ugly URLs.
Place images where search engines can find them
- Use the HTML
imgelement (orpicture). Google has stated it does not index CSS background images for image search. - Put images near relevant text. Captions and nearby paragraphs give context that alt text alone cannot.
- Check robots.txt is not blocking your image folder or CDN host.
- Consider an image sitemap or image entries in your existing sitemap if images load in ways crawlers might miss, such as through JavaScript galleries.
- Keep image URLs stable. Changing them often makes search engines rediscover and reprocess them.
Choose the right format
| Format | Best for | Notes |
|---|---|---|
| AVIF | Photos, complex images | Often the smallest files; encoding is slower; supported by current major browsers. |
| WebP | Photos and graphics | Usually much smaller than JPEG or PNG; supports transparency; very broad support. |
| JPEG | Photos (fallback) | Universal support; no transparency. |
| PNG | Screenshots, graphics needing lossless quality | Can be large for photos; use only when you need lossless output. |
| SVG | Logos, icons, simple illustrations | Vector, scales without blur, tiny when simple. Sanitize uploaded SVGs, since they can contain scripts. |
| GIF | Rarely | Animated GIFs are heavy; a short muted video is usually far smaller. |
The format itself is not a ranking factor. What matters is the effect on load time. You can serve a modern format with a fallback using picture:
<picture>
<source srcset="/images/oak-table.avif" type="image/avif">
<source srcset="/images/oak-table.webp" type="image/webp">
<img src="/images/oak-table.jpg" alt="Oak six-seater dining table"
width="1200" height="800">
</picture>
Get the size right: dimensions and file weight
The most common image mistake is uploading a 4000-pixel-wide camera photo and displaying it in an 800-pixel column. The browser downloads every pixel, then scales it down.
Resize to the display size
Export images at roughly the largest size they will display, allowing for high-density screens (often about twice the CSS width). Then let the browser pick an appropriate file with srcset and sizes:
<img src="/images/oak-table-800.webp"
srcset="/images/oak-table-400.webp 400w,
/images/oak-table-800.webp 800w,
/images/oak-table-1600.webp 1600w"
sizes="(max-width: 600px) 100vw, 800px"
alt="Oak six-seater dining table" width="800" height="533">
Compress sensibly
For lossy formats, moderate quality settings usually look identical to the original at a fraction of the weight. Compare visually at 100% zoom rather than chasing a number. Strip unnecessary metadata, but be aware that removing all EXIF data also removes copyright and orientation information, so keep what you need.
Measure the result
Run important pages through a Page Size Checker to see total page weight, and through a Page Speed Checker to see Core Web Vitals and image-specific suggestions such as "properly size images" or "serve images in next-gen formats." Fix the largest files first; one oversized hero image often outweighs everything else on the page.
Protect Core Web Vitals
- Always set
widthandheight. The browser reserves space before the image loads, preventing layout shifts that hurt CLS. CSS likemax-width: 100%; height: auto;keeps it responsive. - Lazy-load images below the fold with
loading="lazy". - Do not lazy-load the LCP image. The hero or main product image is often the Largest Contentful Paint element; lazy-loading delays it. Load it normally and consider
fetchpriority="high". - Serve images from a fast host or CDN with long cache lifetimes for files whose names change when their content changes.
<!-- Hero image: load early -->
<img src="/images/hero.webp" alt="Workshop with handmade oak furniture"
width="1600" height="900" fetchpriority="high">
<!-- Gallery further down: load later -->
<img src="/images/oak-chair.webp" alt="Oak dining chair with woven seat"
width="600" height="600" loading="lazy">
Captions, titles and structured data
Alt text is not the only text that helps. Captions are among the most-read text on a page, so a short figcaption-style line under an important image (written as a normal paragraph if your editor does not support figures) adds context for readers and search engines alike. The title attribute, by contrast, adds little: it shows only on mouse hover, is ignored by many screen readers and is not a substitute for alt text.
For product, recipe and article pages, structured data can reference images too. Product markup with an image property, for example, can make your photos eligible to appear with product details in search features. Make sure the images in markup are the same ones shown on the page, are crawlable, and are large enough; Google's structured data documentation lists minimum sizes and aspect ratios for some features.
Common image SEO mistakes
- Every image on a page sharing the same alt text, often the page title.
- Important text baked into images instead of written as HTML, which makes it harder to read on mobile, harder to translate and less accessible.
- Product images loaded only by JavaScript after user interaction, so crawlers never see them.
- Huge PNG photos where a WebP would be a fraction of the size.
- Lazy-loading everything, including the hero image.
- Stock photos with no context, which add weight but little meaning.
Next steps
- Pick your five highest-traffic pages and check them for oversized images and missing dimensions.
- Rewrite alt text for meaningful images; set
alt=""on decorative ones. - Convert large photos to WebP or AVIF and generate two or three sizes for
srcset. - Make sure the main above-the-fold image is not lazy-loaded.
- Set a naming convention so new uploads get descriptive file names from the start.