Underscores or Hyphens for SEO URLs

Did you know there is a big difference between using underscores and hyphens in your SEO URLs? In this article, you’ll learn which method Google prefers (and why) - plus, I’ll share some of my best practices for SEO and URLs.

Should You Use Underscores or Hyphens for SEO URLs?

You should use hyphens ( - ) in your URLs. Google universally recognizes them as word separators, unlike underscores ( _ ), which we often use for filters, UTM, etc.

Underscores in your URLs will not be recognized

For example, Google would interpret the phrase “learn_seo-for beginners” (with underscores) as “learnseoforbeginners.”

“Learn-SEO-for-beginners” (with hyphens) is more legible to Google’s robots, and they would interpret it correctly as “learn SEO for beginners.” 

From there, the bots can return your page as a result for different keyword combinations, such as:

  • How to learn SEO 
  • SEO for beginners
  • Learn SEO online free step by step
  • SEO 101
  • Search engine optimization tutorial
  • SEO course
  • Search engine optimization techniques

The easier it is for Google to read and interpret your URLs, the more your site will appear for relevant search queries. 

Plus, when you look at it from a UX perspective - dashes are easier to understand for visitors. They’re clearly visible, unlike underscores, which may often look like pure spaces in an URL. 

Underscores in URL
It’s hard to see the underscores with the standard online hyperlink formatting.

The Underscore vs. Hyphen Debate

The debate surrounding URL structure within the SEO industry has existed for some time. The bone of contention started due to a poorly-worded comment by Google's Matt Cutts in 2007. It implied that Google considered underscores to be word separators.

Matt promptly rectified this idea on his blog, but the misconception lingered. In August of 2011, Google's Matt Cutts released a video reaffirming unambiguously that hyphens are the way to go for SEO URLs and will remain so for the foreseeable future.

As Google’s Gary Illyes confirmed in 2022:

“There's a difference and that's in our segmenter. Basically we use some parts of the URL for understanding what the page is about. And the way it works is that we need to be careful about where we are segmenting because many things on the internet, things that people write about have an underscore in them, so we can't easily segment at underscore and that's why we are recommending dashes.”

Why Do URLs Matter So Much?

URLs are vital for SEO because, in addition to your website content, such as titles, meta descriptions, and headings, search engines use URLs to determine the content of your page and how it should rank.

What If I Used Underscores?

If you’re currently using underscores in URLs and still getting the results you want, there is no need to remove or change them. 

If you’re having trouble ranking with underscores, use 301 redirects to point the old page’s signals to the hyphenated new one.

Once you move to a structure using hyphens, it will take Google some time to crawl and index the new URLs, so keep an eye on potential errors with an SEO audit tool like SiteGuru. 

Can I Use Hyphens in Domain Names?

Domain name SEO is a whole ‘nother beast, but as a rule of thumb: don’t use hyphens in domain names.

While it may look good, most visitors are used to domain names that contain unseparated words. “Cocacola.com” is intuitive, “coca-cola.com” is not. Similarly, spammy websites often use hyphens in their domain names.

Additionally, dashes and hyphens make it challenging to advertise by word-of-mouth or on the radio. 

How to Use Hyphens in URLs: Tips & Best Practices

The best SEO practice is to include a hyphen to separate two or multiple words. Hyphens allow Google to index all keywords individually.

Follow a Standard URL Structure 

When including categories and subcategories in URL, avoid taking things too far:

  • Intuitive structure: examplesite.com/women/dresses
  • Too much: examplesite.com/womens/dresses/short-sleeves/floral/knee-length/nameofthespecificdress

In the latter case, you’ll be better off using faceted navigation and AJAX filtering.

Anatomy of a URL

Be as consistent as possible in your URL structure. Use a website taxonomy with categories and sub-categories to organize content intuitively.

Check Auto-Generated URLs and Remove Stop Words

Some websites have plugins that auto-generate URLs for them. If you use a tool like Yoast, check your permalinks to remove unsubstantial stop words you can’t rank for (e.g., “to,” “and,” etc.). 

For example, don’t use this URL: “examplesite.com/how-to-prevent-hiking-injuries-from-boots-and-gear”.

Instead, remove the stop words: “examplesite.com/prevent-hiking-injuries-boots-gear”.

If you don’t use a tool, use the right keywords in your URL instead of numerical parameters. 

Include Your Keyword in the URL

The keyword you want to rank for should be a part of your URL. Then, use hyphens to separate distinct words.

For example, let’s say we wanted to review Burr coffee grinders. 

If our target keyword is “burr coffee grinder,” our URL would look something like this:

  • “allaboutcoffee.com/best-burr-grinders”

Use Canonical Tags (If Needed)

If, for any reason, one of your pages is tied to multiple URLs, use canonical tags to make it clear to Google which version you want it to index.

For example, you could have non-www and www or HTTP and HTTPS duplicates

The Definitive Answer to Underscores vs. Hyphens in SEO

Use hyphens. Both Google and searchers love them. 

However, if you already have URLs that rank well with underscores, don’t change them. Keep an eye on them with an SEO audit tool and set up 301 redirects only if they affect your ranking.


What is the difference between hyphens, en, and em dashes?

Hyphens are not the same as dashes and shouldn’t be used interchangeably.

The hyphen ( - ) is a punctuation mark that pairs two words or joins two parts of words together. 

The en dash is longer than a hyphen but shorter than an em dash ( – ). The en dash is most commonly used to write dates and to represent numerical ranges.

The em dash is the longest dash ( — ) and can be used to replace commas, quote marks, question marks, or parentheses in a text.

In SEO, you should use hyphens ( - ). 

Do underscores affect my ability to rank?

Not necessarily, but if other pages use hyphens and descriptive URLs (and you’re not), it could affect your click-through rate.

Firstly, hyphens are typically used in file-naming conventions, making it easier for Google to parse and rank correctly. (See my explanation above.)

Secondly, hyphenated URLs are easier for visitors to understand and look more legitimate.

What’s the best character to represent blank spaces in a URL?

 Use hyphens to represent blank spaces.