hello world!

Image Filenames

Written by: Lars Erik Larson  | January 12, 2020

What Is An Image Filename?

Every image on the internet has a unique name given to it — this is called the image filename.

Here is what it looks like as HTML.

You can also see the filename of an image when saved offline, on your computer.

When you create, edit or save an image, you give it a filename.

Images come in various different file formats (such as PNG above.) This has no bearing on the name.

You can give an image just about any filename, although there are some exceptions.

The maximum length is 256 characters.

You can't use any of these types of characters:

# < > [ ] | : { } / ~

You can view the filename of any image on the internet — here's how.

Right click on the image and select "Inspect."

The image HTML should come up — look for the src tag — focus on the unique end slug (highlighted below.)


That's the image filename.

Why Is The Image Filename Important For SEO?

Because Google (and other search engines) can't see images like we do.

We see the image.

They see the image HTML — search engines see only the web source code in the back-end.

So when it comes to SEO for images, the HTML is all you've got to communicate to Google.

The image filename (along with the image alt-text) tells search engines exactly what an image is about.

I like to think of the filename as a short-tail keyword for images.

You're also probably wondering why images are even important for SEO in the first place.

I'll give you 2 main reasons why.

  1. Images can help give search engines a better idea to what your overall webpage is about.
  2. Optimizing images for SEO can help you rank for image searches.

The image filename and alt-text can help add to other HTML elements (like the page title.) This gives search engines a better idea on what a particular webpage is about.

Here's a good example — an article about how to shave your dog.

Look at this image.

Look at the image filename and alt-text.

The more information you can give search engines — like Google — the better your SEO efforts will be.

Ranking for image searches is also important because they provide more pathways for traffic to reach your website/webpages.

Look what happens when I image search "How to shave your dog."

5 of the first 10 images are from that article — these are all pathways to your webpage/website.

Some websites generate majority of their traffic (and revenue/sales) from image searches.

Stock image websites — such as Shutterstock — is a good example of this.

Best Practice

Avoid Generic Filenames

The first thing you'll want to do is to avoid giving your image a generic filename.

What is considered generic?

Here are some examples of generic filenames.

  • Image01.png
  • Joe.jpg
  • DSC00001.JPG
  • 309969513162641.jpg

When you fail to give your image a filename, you'll be given a generic default, similar to the above examples.

The problem with these generic image filenames is that they tell Google (and other search engines) nothing.

Your image's filename (along with the alt-text) is supposed to give information on what the image is about.

A filename that tells nothing about the context of an image provides no SEO value.

Takeaway: Avoid giving your image a "generic" or default filename.

Describe The Image Accurately

You'll want to describe your image with as much clarity and specificity as possible.

Your image filename needs to tell search engines exactly what the image is about.

Here are some good examples.

  • City of London skyline from London City Hall - Oct 2008.jpg
  • KDE Kicker config screenshot.png
  • 1863 Meeting of Settlers and Maoris at Hawke's Bay, New Zealand.jpg
  • Polyhedron with no vertex visible from center.png

Google even highlights the importance of a "descriptive" image filename in its best practice guide.

The filename can give Google clues about the subject matter of the image. For example, my-new-black-kitten.jpg is better than IMG00023.JPG

This doesn't really need to get complicated — simply describe your image in a succinct, precise manner.

Some images however, will need a bit more context to be accurately described.

Here's an example.

An image of the London skyline.

The image filename is City of London skyline from London City Hall - Oct 2008.jpg

This provides some additional information:

  1. The date the image was taken
  2. The position from which the image was taken

Don't forget to consider the use of hyphens to separate words, and to keep it short (these are covered further down.)

Takeaway: Describe your image accurately, succinctly and specifically.

Use A Keyword

Like most other HTML tags, the image filename is a good place to put a keyword.

When Googlebot comes to crawl your webpage, it's going to be looking at your images. It's only good things SEO-wise if it finds a keyword there.

This largely relates to the "accurately describing your image" point listed earlier.

The images you use should have high relevance to the topic of your webpage, and thus your keyword/s.

Look at this example — How to Wash a Dog.

Look at the filename for the first image.

A keyword has been featured — you can bet this will help Google better crawl, rank and index this webpage.

Remember, it needs to be actually relevant to the image. It needs to actually describe the image.

Takeaway: Put a keyword in your filename if it's an accurate description of the image.

Avoid Keyword Stuffing

So, you'll want to use a keyword in your filename — if it fits — but you need to avoid overdoing it.

When you overuse keywords, it's called "keyword stuffing."

When search engines (like Google) notice you have used a keyword too frequently, they will penalize you.

You can even get de-indexed (completely removed.)

Search engines (like Google) over time have become more and more "semantic."

This means that they've become more logical, smarter. They can tell when you're trying to game the system — like keyword stuffing.

The fix is simple — only use keywords when it actually describes the image.

Takeaway: Only use keywords in your image filenames when it's an accurate description.

Keep It As Short As Possible

As was stated at the beginning of this post, the maximum length of an image filename is 256 characters.

But exactly what is the optimal length?

The truth is, there isn't one.

Some image filenames are only 1 word.

While some can be over 50+ characters.

Naturally, some images (like the 1863 one above) require more words to be accurately described.

So it wouldn't really make sense for there to be an exact number.

This is different to something like say, the page title. It's firmly placed in back-end web source code.

User experience really isn't a factor here.

I still recommend keeping it short — as short as it can possibly be — given you accurately describe it.

There is no need to put in filler or fluff. God forbid don't keyword stuff. Detail all the important things to describe the image as accurately as possible.

However long that is.

No more, no less.

Takeaway: Describe your image accurately, in the shortest, most precise manner.

Use Hyphens (Not Underscores)

Regarding your image filenames, It's important to remember use hyphens to separate words, not underscores.

You want it to look like this.

Not this.

Or this.

When it comes to HTML, hyphens (-) signal a break in words to search engines. They are considered a "word separator."

Google's own filename and file types guide recommends using hyphens, not underscores.

They even outline some examples similar to the ones I gave you earlier.

Using underscores won't ruin your image filename, but it's best to just use hyphens.

Takeaway: Use hyphens (-) to separate words in your image filename.

Final Thoughts

The filename is like the short-tail keyword of the image — it tells search engines (like Google) just exactly what it's looking at.

A high quality image filename can help your webpage rank better, and your images too (for image searches.)

Knowing how to best optimize the image filename is important. In this post we covered everything you need to know.

To learn more about SEO, continue reading the guides in our learning hub, and join our mastermind community group here: SERP University.

Get Your Free Report

This FREE Report reveals the most powerful SEO trade secrets for boosting your organic rankings and flooding your business with buyers!

© SERP Co 2021 . All rights reserved.
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram