How to Optimize Images for SEO and Faster Pages
Formats, compression, file names, alt text and loading tips that make images fast and searchable.
Images are often the heaviest part of a web page and the main reason it loads slowly. They are also a source of traffic in their own right through Google Images and Lens. Optimizing them improves both speed and visibility.
1. Choose the right format
- WebP โ much smaller than JPG or PNG at similar quality, supported by modern browsers. A good default.
- AVIF โ even smaller, with growing support.
- JPG โ for photos when you cannot use WebP.
- PNG โ for graphics needing transparency; avoid for photos.
- SVG โ for logos and icons; tiny and sharp at any size.
2. Resize before uploading
Do not upload a 4000-pixel photo to display at 800 pixels. Resize to roughly the largest size it will be shown (allowing for high-density screens). This alone often cuts file size by 80% or more.
3. Compress
Compress images with an image editor or compression tool. Aim for the smallest file that still looks sharp. Most product and blog photos can be well under 200 KB.
4. Use descriptive file names
cotton-saree-maroon.webp tells search engines more than IMG_4021.jpg. Use lowercase words separated by hyphens.
5. Write good alt text
Describe what the image shows. It helps accessibility and image search. See image alt text best practices.
6. Set width and height
Always include width and height attributes so the browser reserves space and the layout does not jump while loading โ this improves CLS, one of the Core Web Vitals.
7. Lazy-load below-the-fold images
Add loading="lazy" to images further down the page so they load only when needed. Do not lazy-load the main image at the top โ it should load first.
8. Place images near relevant text
Search engines use the surrounding text, captions and page title to understand images. Put each image next to the content it illustrates.
9. Make sure images actually load
Broken images waste the work. Test image URLs in bulk with the image URL checker and check pages for missing alt text and heavy files with the free site audit.
A before-and-after example
A recipe blog's article page weighed 6.8 MB, mostly from eight phone photos uploaded straight from the camera at 4000 pixels wide. Resizing them to 1200 pixels, converting to WebP and compressing brought the page to 780 KB. The largest image appeared more than two seconds sooner on mobile, and the page passed its Core Web Vitals assessment the following month. Renaming files from IMG_xxxx to descriptive names and writing alt text also helped the photos start appearing in Google Images.
Related guides
More free tools: browse all our free utility tools, no sign-up needed.
Frequently asked questions
What is the best image format for websites?
WebP is a good default for most images; SVG for logos and icons.
How big should website images be?
As small as possible while looking sharp โ often under 100โ200 KB for photos.
Does image SEO bring traffic?
Yes, especially for products, recipes, travel and design topics through Google Images and Lens.
Should I lazy-load every image?
No. Lazy-load images below the first screen; load the main image immediately.