🔍 Image SEO

SEO-Friendly Image Names:
The Complete 2026 Guide

Your image filenames are a direct signal Google uses to rank your images — and most websites get them completely wrong. This guide covers every rule for naming image files for SEO, with 40+ real-world examples across every industry, plus scripts to bulk-rename existing images without breaking your site.

By IMGVO Team
Updated June 2026
13 min read
~3,000 words
22.6%
Of all US web searches happen on Google Images (SparkToro)
~65%
Of product pages use generic filenames like IMG_4872.jpg
3–5
Words — the ideal image filename length for SEO

1. Why Image Filenames Matter for SEO

Google's own documentation states that "the filename can give Google clues about the subject matter of the image." This isn't a minor hint — filenames are one of the explicit signals Google uses to understand and rank images in both Google Image Search and standard web search.

When Google crawls your page, it looks at several signals to understand each image: the filename, the alt attribute, the surrounding text, the page title, and structured data. The filename is the first signal in the chain — it's visible in the image URL before any page content is rendered.

💡 The Full Image SEO Signal Stack

Filename → Alt text → Surrounding body text → Image caption → Page title/H1 → Structured data (ImageObject). All signals reinforce each other. A great filename paired with weak alt text still underperforms versus both being well-optimized.

What You're Losing with Generic Filenames

A filename like IMG_4872.jpg or photo-1.png tells Google absolutely nothing. You're throwing away a free, permanent optimization signal on every single image. For an e-commerce site with 5,000 product images, that's 5,000 missed ranking opportunities.

Google Image Search drives real commercial traffic — especially for product, recipe, and how-to content. A well-named image can rank independently of the parent page and bring in visitors who never would have found the page through regular search.


2. The 6 Golden Rules of SEO Image Naming


3. Hyphens vs. Underscores: The Definitive Answer

This is one of the most common questions in image SEO — and it has a clear, documented answer.

✓ Hyphens — Correct
red-leather-sofa.jpg

Google reads this as three separate words: red, leather, sofa. All three are indexable keywords.

✗ Underscores — Wrong
red_leather_sofa.jpg

Google reads this as one word: "red_leather_sofa". None of the individual terms are separately indexed.

Google's John Mueller has confirmed this multiple times: hyphens are treated as word separators in URLs; underscores are treated as word joiners. This applies to both page URLs and image filenames.

💡 What About Spaces?

Spaces in filenames get URL-encoded to %20 — so red leather sofa.jpg becomes red%20leather%20sofa.jpg in the browser. While this technically works, it makes filenames fragile, breaks in some tools, and looks unprofessional. Always use hyphens.

SeparatorGoogle reads asRecommendation
red-sofa.jpg"red" + "sofa" (2 words)Use This
red_sofa.jpg"red_sofa" (1 word)Avoid
redSofa.jpg"redSofa" (1 word)Avoid
red sofa.jpg"red" + "sofa" (encoded as %20)Avoid
RedSofa.jpg"RedSofa" (case-sensitive risk)Avoid

4. Anatomy of a Perfect Image Filename

A well-structured image filename follows a consistent pattern: subject → descriptor → context → variant. Not every image needs all four parts — but understanding each one helps you write better filenames faster.

Filename anatomy

nike-air-max-270-white-volt-side-view.webp
Subject — the primary item shown
Descriptor — color, size, material, variant
Context — angle, use, location, type
Extension — lowercase, modern format

More Anatomy Examples

✓ E-commerce
linen-duvet-cover-king-white.webp

Product → material → variant → size → color

✓ Food / Recipe
sourdough-bread-sliced-overhead.webp

Subject → state → angle — all indexable terms

✓ Real Estate
open-plan-kitchen-brooklyn-apartment.webp

Room type → style → location — great for local SEO

✓ Software / UI
IMGVO-compress-image-dashboard.webp

Brand → feature → page type — brand + keyword


5. Examples by Industry — 40+ Real Filenames

Different industries need different filename strategies. Here's how to apply the rules across the most common use cases.

🛒 E-Commerce
  • nike-air-max-270-white-mens.webp
  • leather-crossbody-bag-tan-small.webp
  • standing-desk-oak-120cm-front.webp
  • ceramic-pour-over-coffee-set.webp
  • mens-wool-coat-navy-size-l.webp
🍕 Food & Recipe
  • classic-margherita-pizza-overhead.webp
  • sourdough-starter-day-5-bubbling.webp
  • grilled-salmon-lemon-herb-plate.webp
  • matcha-latte-iced-glass.webp
  • chocolate-lava-cake-plated.webp
🏠 Real Estate
  • open-plan-kitchen-brooklyn-apt.webp
  • master-bedroom-walk-in-closet.webp
  • rooftop-terrace-manhattan-view.webp
  • scandinavian-living-room-fireplace.webp
  • home-office-built-in-shelves.webp
✈️ Travel
  • santorini-sunset-oia-village.webp
  • kyoto-bamboo-forest-arashiyama.webp
  • amalfi-coast-cliffside-village.webp
  • machu-picchu-morning-fog.webp
  • bali-rice-terraces-ubud.webp
💻 Software / SaaS
  • dashboard-analytics-monthly-report.webp
  • onboarding-flow-step-2-invite.webp
  • mobile-app-dark-mode-home.webp
  • pricing-table-pro-plan.webp
  • api-documentation-code-example.webp
💪 Health & Fitness
  • deadlift-form-starting-position.webp
  • meal-prep-bowls-5-day-plan.webp
  • yoga-warrior-pose-outdoor.webp
  • foam-roller-upper-back-stretch.webp
  • hiit-workout-timer-phone.webp
🏥 Medical / Health Info
  • vitamin-d-supplement-capsules.webp
  • blood-pressure-monitor-home-use.webp
  • anatomy-shoulder-rotator-cuff.webp
  • sleep-hygiene-bedroom-routine.webp
  • healthy-plate-portion-guide.webp
🏗️ B2B / Industrial
  • cnc-machined-aluminum-part.webp
  • warehouse-racking-system-heavy.webp
  • forklift-operator-safety-training.webp
  • industrial-conveyor-belt-system.webp
  • solar-panel-installation-roof.webp
💡 Pattern to Notice

Every good filename above answers: what is it, what does it look like or where is it, and what context is it in? If your filename answers all three in 3–5 words, it's a good filename.


6. Filename vs. Alt Text: How They Work Together

Filenames and alt text are complementary, not redundant. They serve different purposes and are read by different systems at different times.

SignalRead ByWhenPurpose
FilenameGoogle crawler, CDN logs, analyticsOn crawl, before page rendersURL-level keyword signal for indexing
Alt textScreen readers, Google, browser fallbackWhen page rendersAccessibility + contextual keyword signal
CaptionSighted users, GoogleWhen page rendersUser-facing context, supports alt text

The Right Relationship Between Filename and Alt Text

They should describe the same image from slightly different angles — consistent but not identical. The filename is a concise slug; the alt text can be more descriptive and human-readable.

✓ Consistent (Good)
nike-air-max-270-white.webp

alt= "Nike Air Max 270 in white colorway, side view on white background"

✗ Contradictory (Bad)
IMG_9821.jpg

alt= "Nike Air Max 270 in white"
Filename gives zero signal — missed opportunity.

✗ Identical (Redundant)
nike-air-max-270-white.webp

alt= "nike-air-max-270-white"
Alt text should be human-readable, not a slug copy.

✓ Complementary (Best)
sourdough-loaf-overhead.webp

alt= "Freshly baked sourdough loaf with scored crust, overhead shot on wooden board"


7. Folder Structure and URL Path SEO

The folder path your image lives in is also part of its URL — and therefore also a signal. A well-organized image directory reinforces the filename's keyword signal.

✗ Generic Structure
/images/IMG_4872.jpg

No context at any level. Folder and filename are both wasted signals.

✓ Semantic Structure
/images/sofas/red-leather-sofa-3-seater.webp

Category folder + descriptive filename = two levels of keyword context.

Recommended Folder Structure by Site Type

Directory Structure
# E-commerce site
/images/
  products/
    sofas/
      red-leather-sofa-3-seater-front.webp
      red-leather-sofa-3-seater-side.webp
    chairs/
      ergonomic-office-chair-mesh-black.webp
  blog/
    how-to-clean-leather-sofa-steps.webp
  brand/
    logo-horizontal-white.svg

# Recipe / food blog
/images/
  recipes/
    pasta/
      spaghetti-carbonara-plated-overhead.webp
    desserts/
      tiramisu-slice-espresso.webp
  how-to/
    pasta-dough-rolling-technique.webp
💡 CDN and Image Path Strategy

If you use a CDN or image transformation service, ensure the canonical image URL (the one in your HTML src attribute and sitemap) reflects your semantic folder structure. CDN-specific paths like cdn.example.com/f_auto,q_80/v1/products/img001.jpg carry no keyword signal from the transformation parameters.


8. Renaming Existing Images Without Breaking SEO

Renaming images that are already indexed carries some risk — Google has to re-crawl and re-index the new URLs. Done correctly, the long-term SEO gain outweighs the short-term disruption.

Step-by-Step Rename Protocol

  1. Audit first. Use Screaming Frog or a site crawl to get a full list of current image URLs. Export to a spreadsheet.
  2. Plan new names. Map each current filename to its new SEO-friendly name. Keep the extension the same for now (you can convert formats separately).
  3. Rename files on the server. Use a bulk rename script (see Section 9) to rename files and generate a redirect mapping simultaneously.
  4. Set up 301 redirects. For every renamed image, add a 301 redirect from the old URL to the new URL in your .htaccess (Apache) or Nginx config. This preserves any backlinks pointing to the old image URL.
  5. Update all src references. Search your HTML, CSS, and JS for every old filename and update to the new one. Don't rely only on redirects — update the source.
  6. Update your image sitemap. If you have an image sitemap (recommended), regenerate it with the new URLs.
  7. Request re-indexing. Submit your updated sitemap via Google Search Console. Use the URL Inspection tool on key pages to trigger faster re-crawling.
⚠ Don't Rename Everything at Once

If you have thousands of images, rename in batches of 200–500 at a time, spaced a few weeks apart. Mass URL changes can temporarily confuse Google's understanding of your site structure and cause brief ranking drops across unrelated pages.


9. Bulk Rename Scripts

Manual renaming doesn't scale past a few dozen images. These scripts automate the process and output a redirect map as a side effect.

Bash — Rename All JPEGs in a Folder

Bash
#!/bin/bash
# Converts filenames to lowercase and replaces spaces/underscores with hyphens
# Usage: ./rename-images.sh ./images/products

DIR="${1:-.}"

find "$DIR" -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" -o -iname "*.webp" \) | while read -r FILE; do
  DIR_PATH=$(dirname "$FILE")
  BASENAME=$(basename "$FILE")

  # Lowercase, replace spaces and underscores with hyphens
  NEWNAME=$(echo "$BASENAME" | tr '[:upper:]' '[:lower:]' | sed 's/[ _]/-/g')

  if [ "$BASENAME" != "$NEWNAME" ]; then
    mv "$DIR_PATH/$BASENAME" "$DIR_PATH/$NEWNAME"
    # Output redirect map: old → new
    echo "Redirect 301 /images/$BASENAME /images/$NEWNAME" >> redirects.conf
  fi
done

echo "Done. Redirects saved to redirects.conf"

Python — Rename with CSV Audit Log

Python
import os, re, csv
from pathlib import Path

IMAGE_DIR = "./images"
LOG_FILE  = "rename-log.csv"
EXTS      = {".jpg", ".jpeg", ".png", ".webp", ".gif"}

def seo_name(name: str) -> str:
    name = name.lower()
    name = re.sub(r'[\s_]+', '-', name)      # spaces/underscores → hyphens
    name = re.sub(r'[^a-z0-9\-\.]', '', name) # strip special chars
    name = re.sub(r'-{2,}', '-', name)        # collapse multiple hyphens
    return name

with open(LOG_FILE, 'w', newline='') as log:
    writer = csv.writer(log)
    writer.writerow(["old_path", "new_path", "status"])

    for p in Path(IMAGE_DIR).rglob("*"):
        if p.suffix.lower() not in EXTS:
            continue
        new_name = seo_name(p.stem) + p.suffix.lower()
        new_path = p.parent / new_name
        if p.name == new_name:
            writer.writerow([p, new_path, "unchanged"])
            continue
        p.rename(new_path)
        writer.writerow([p, new_path, "renamed"])

print(f"Done. Audit log saved to {LOG_FILE}")
💡 Dry Run First

Before running any rename script on production, test with a dry run: replace the mv / p.rename() call with a print() statement to preview all changes without modifying any files.


10. Image Filename SEO Checklist


11. Frequently Asked Questions

Convert Images to WebP While Renaming

Pair your new SEO-friendly filenames with modern formats. IMGVO converts JPEG and PNG to WebP or AVIF in seconds — free, no signup, no upload limits.

Convert Images Free →

Related Guides

Complete your image SEO — every signal, optimized.