Image SEO Guide: File Names, Alt Text and Compression Done Right

Images make web pages more engaging, but they are also one of the most common reasons sites load slowly and miss out on search traffic. Optimizing images for SEO means making sure every photo, diagram and product shot is easy for search engines to understand, accessible to people using screen readers and light enough to load quickly on a mobile connection.
The good news is that image optimization is one of the most approachable parts of SEO. You do not need advanced technical skills, just a repeatable process. This guide walks through file names, alt text, formats, compression and delivery so your images work for you in 2026.
If you manage a large existing site, do not feel you must fix every image at once. Start with your most visited pages and your most important product or service pages, then work outward. Improvements there have the biggest effect on both user experience and search performance.
Why Image Optimization Matters
Image optimization supports several goals at once:
- Image search traffic: well-described images can appear in Google Images and in visual results within regular search, bringing extra visitors.
- Page speed: images are frequently the largest files on a page. Oversized images can hurt loading performance, including Largest Contentful Paint, one of the Core Web Vitals.
- Accessibility: alt text lets people using screen readers understand visual content, which is both good practice and, in many places, a legal expectation.
- Context: relevant images with good descriptions help search engines understand what a page is about.
- User experience: crisp, fast-loading images keep visitors engaged rather than waiting for content to appear.
Step 1: Use Descriptive File Names
Search engines read file names as a small clue about an image’s content. A camera default like IMG_4821.jpg tells them nothing, while a name like stainless-steel-french-press.jpg is clear.
File Naming Best Practices
- Describe what the image actually shows in a few words.
- Use lowercase letters and separate words with hyphens rather than underscores or spaces.
- Include a relevant keyword when it fits naturally, without forcing it.
- Keep names reasonably short and avoid stuffing several keywords together.
- Rename files before uploading, since many content management systems build the image URL from the original file name.
Step 2: Write Helpful Alt Text
Alt text, often called alt tags, is the text alternative in an image’s HTML alt attribute. Screen readers read it aloud, browsers display it if the image fails to load, and search engines use it to understand the image. Writing good alt text is the single most important part of optimizing images for SEO and accessibility at the same time.
How to Write Good Alt Text
- Describe the image accurately and specifically, as if explaining it to someone who cannot see it.
- Keep it concise, usually a short sentence or phrase.
- Include a keyword only where it genuinely describes the image.
- Skip phrases like image of or picture of; screen readers already announce that it is an image.
- For purely decorative images, use an empty alt attribute so screen readers skip them.
- For charts or infographics, summarize the key point and provide fuller detail in the surrounding text.
For example, instead of alt text that just says shoes, write something like red leather running shoes with white soles. The second version helps visually impaired visitors and gives search engines much clearer context.
Step 3: Choose the Right Format
Different formats suit different kinds of images. Modern formats can deliver similar visual quality at noticeably smaller file sizes than older ones, and they are widely supported by current browsers.
| Format | Best For | Notes |
|---|---|---|
| WebP | Most photos and graphics on the web | Good compression with lossy and lossless options and transparency support |
| AVIF | Photos where file size matters most | Often smaller than WebP at similar quality; encoding can be slower |
| JPEG | Photographs needing maximum compatibility | Universally supported; larger than modern formats at equal quality |
| PNG | Screenshots, graphics with sharp edges or transparency | Lossless but often large for photos |
| SVG | Logos, icons and simple illustrations | Vector format that scales cleanly and is usually tiny |
Many content management systems and image plugins can generate WebP or AVIF versions automatically while keeping a fallback for older browsers.
Step 4: Resize and Compress
Uploading a photo straight from a modern phone or camera often means serving an image thousands of pixels wide when it will display at a fraction of that size. Resize images to the largest dimensions they will actually appear at, allowing extra for high-density screens.
Then compress them. Lossy compression removes detail the eye barely notices and can shrink files dramatically; lossless compression reduces size without changing any pixels. For most photos, a moderate lossy setting gives the best balance. Always check the result visually, particularly for product images where detail matters to buyers. Desktop tools, online compressors and CMS plugins can all handle this, and many can process images in bulk.
Step 5: Deliver Images Efficiently
Responsive Images
Use responsive image markup, such as the srcset and sizes attributes, so browsers can choose an appropriately sized file for each screen. Mobile visitors then download small versions instead of desktop-sized images.
Lazy Loading
Native lazy loading delays offscreen images until a visitor scrolls near them, saving bandwidth and speeding up initial load. Do not lazy-load the main image at the top of the page, since that can delay the most important content.
Set Width and Height
Specifying image dimensions lets the browser reserve space before the image loads, preventing content from jumping around and improving Cumulative Layout Shift.
Use Caching and a CDN
Long cache lifetimes and a content delivery network help repeat visitors and users far from your server load images faster.
Build a Repeatable Image Workflow
Consistency is what turns occasional fixes into lasting results. When optimizing images for SEO across a team, write a short checklist that everyone follows before publishing: rename the file, resize it, compress it, convert to a modern format if your system does not do this automatically, and add alt text and a caption where useful. Store the checklist where writers and designers will actually see it.
Audit your site periodically too. Crawling tools and page speed reports can list images that are missing alt text, oversized or served in older formats. Fixing the worst offenders first often delivers quick, measurable speed gains.
Extra Steps for Better Image Visibility
Once the basics are in place, a few additional techniques can help your images appear in more places:
- Place images near relevant text, and use captions where they add useful information; captions are often read more than body copy.
- Use original photos where possible rather than widely reused stock images, as unique visuals can stand out in search.
- Add structured data for products, recipes or articles, which can make images eligible for richer search features.
- Include important images in your XML sitemap or an image sitemap if your CMS supports it.
- Avoid embedding key text inside images; search engines and screen readers handle real text far better.
Google’s own Search Central documentation includes a dedicated section on image best practices that is worth bookmarking.
Frequently Asked Questions
Are alt tags and alt text the same thing?
Yes, in everyday use. Technically, alt is an attribute of the HTML image element, and its value is the alt text, but people often call it an alt tag.
Does image compression hurt quality?
Heavy lossy compression can, but moderate settings usually produce no noticeable difference while cutting file size significantly. Always preview the result.
Should every image have alt text?
Every meaningful image should. Decorative images should have an empty alt attribute so assistive technologies ignore them.
Is WebP or AVIF better for SEO?
Neither format is a ranking factor by itself. Both help by reducing file size and improving speed; choose based on your tools and quality needs.
How large should website images be?
There is no single rule. Resize images to the dimensions they display at, compress them, and aim to keep files as small as possible without visible quality loss.
Final Thoughts
Optimizing images for SEO is a small habit with big rewards. Descriptive file names, thoughtful alt text, modern formats, sensible compression and efficient delivery together make pages faster, more accessible and easier for search engines to understand. Build these steps into your publishing routine, and every new image you upload will support your rankings instead of holding them back.