Images and SEO: File Names, Alt Text and the Right Size

By · 24 November 2026 · 5 min read

Illustration of a product photo with file name, alt text and size labels, beside a large file marked in red and a compact file marked in green

Your team has just uploaded twenty new product photos to the website. The files are named IMG_4021.JPG to IMG_4040.JPG, each one is several megabytes and the alt text field has been left empty. The photos look good, but to Google they say almost nothing. And the page now loads more slowly on mobile.

The good news is that fixing this isn't hard. This article covers three habits to build every time you upload an image: the file name, the alt text and the right size.

Why images deserve attention

Images do three jobs at once. First, they can bring visitors through Google Images, for example when a potential buyer searches for a particular type of product. Second, they help people using screen readers understand the page. Third, images are often the largest part of a page's size, so they have a big effect on speed.

Google understands images from several clues: the file name, the alt text, the page title and the text around the image. You can control all of them yourself.

A file name that describes the content

Google recommends short but descriptive file names. Google's own example: my-new-black-kitten.jpg is better than IMG00023.JPG. Generic names such as "image1.jpg" are best avoided.

  • Use words that describe what is in the photo, for example blue-hdpe-plastic-pallet.jpg.
  • Separate words with hyphens and use lower case, so names stay tidy and consistent.
  • Don't stuff keywords into the file name. Simply describe what is in the photo.
  • Make sure the file extension matches the file type. A WebP file should end in .webp, not .jpg.

The easiest approach is to rename files before uploading. If they are already uploaded, ask your web developer whether your CMS can rename files without breaking images on other pages.

Alt text: describe the image, don't stuff keywords

Alt text is a short description of what an image shows. Screen readers read it aloud for blind and partially sighted users, and it appears on the page if the image fails to load. Google calls alt text the most important attribute for understanding an image.

Google gives a simple example with a puppy photo:

  • Bad: no alt text at all.
  • Bad: a string of keywords such as "puppy dog baby dog pup pups puppies doggies".
  • Better: "puppy".
  • Best: "Dalmatian puppy playing fetch".

Apply the same pattern on a B2B website. Not "best cheap plastic pallets Jakarta", but "blue HDPE plastic pallet with four-way forklift entry". Describe what can be seen, including the details that set this product apart from others.

There is one exception. Purely decorative images, such as divider lines or background patterns, should have empty alt text. Screen readers then skip them, and visitors aren't distracted by descriptions that add nothing.

File size: serve images at the size they are shown

Photos from a modern camera or phone are usually far larger than a page needs. If an image is shown 800 pixels wide but the original file is 4,000 pixels wide, the browser still has to download all of it.

  • Match the dimensions. web.dev recommends displaying images at the size of their container, allowing for high-resolution screens.
  • Provide several sizes. With the srcset attribute, the browser can choose a small version for phones and a large one for wide screens. Google reminds you to keep a main image address in the src attribute as a fallback.
  • Use modern formats. WebP often produces smaller files than JPEG, PNG or GIF, and in some tests AVIF saves even more. Google supports both.
  • Keep the quality. Don't compress until the image is blurred. Google says sharp photos appeal to users more than blurry ones.

Many modern CMSs can create these sizes automatically when an image is uploaded. Ask your developer whether this is switched on. If your website feels slow, read also why a company website is slow and how to fix it.

Width, height and lazy loading

Ever opened a page and seen the text suddenly jump down as an image appears? That happens because the browser doesn't yet know the image's size. web.dev recommends always giving every image width and height attributes, so the browser can reserve the space from the start.

Then there is lazy loading, which delays loading an image until the visitor scrolls close to it. This saves data for images further down the page. But don't lazy-load images that are visible as soon as the page opens, especially the main image at the top. Those should load as quickly as possible.

Make sure Google can find your images

  • Use ordinary image elements. Google finds images through the img tag. Images set as CSS backgrounds aren't indexed by Google, so important product photos shouldn't be backgrounds.
  • Place images near relevant text. A photo of a pallet belongs on the page and in the paragraph that discusses that pallet.
  • Choose the page's main image. Google can use the og:image tag as a hint about which image represents the page. Pick a relevant one, not a generic logo, and avoid images full of text.
  • Image sitemaps. For large catalogues, an image sitemap helps Google find images it might otherwise miss.

A checklist before you upload

  1. The file name describes the photo, in lower case, separated by hyphens.
  2. The dimensions match the size shown on the page.
  3. WebP or AVIF if the CMS supports it, with quality that stays sharp.
  4. The alt text describes what can be seen. Empty alt text only for decoration.
  5. Images at the top of the page aren't lazy-loaded.
  6. The image sits near the text that discusses it.

For how to take product photos that convince buyers, read product photos for your company website.

A good image isn't just pleasant to look at. Its name is clear, its description is honest and its size is right.

Images are one part of SEO as a whole. Start with how to get your website on Google. If you'd like help tidying up the images on your website, get in touch.