Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Which is better for search engines?

  1. example.com/my_cool_page.html
  2. example.com/my-cool-page.html
  3. example.com/my+cool+page.html
share|improve this question
use + (plus). – Janus Troelsen Oct 31 '12 at 14:36
@JanusTroelsen: You should not use + to represent a space in the path part of the URL (the subject of this question). However, + can be used to encode a space in the querystring (URL parameter value). Related: webmasters.stackexchange.com/questions/32867/… – w3dk Nov 19 '12 at 14:31
Good video about it from a Google engineer: youtube.com/watch?v=AQcSFsQyct8 (Matt Cutts was also mentioned in the accepted answer below) – JohnB May 21 '15 at 15:35

10 Answers 10

up vote 79 down vote accepted

Although there seems to be less difference now than there was in the past, hyphens are recommended if you want each of the terms in your URL recognized as an individual word.

The reason for this is that search engines find it easier to treat hyphens as word separators, just as they are in the English language. Underscores, however, are not normally used in English as word separators. In many cases it is desirable to see them as part of the characters before and after them, for instance when underscores are used in function names for programming, and other similar situations.

There are a couple cases where this might matter. For one, if someone uses the full URL as the anchor text for a link, then the search engines will be able to pull out those terms as relevant words. For another, it is possible that search engines use words in the URL as correlative factors to determine the relevance of those terms to the page content.

Matt Cutts has a dated piece that explains this, and there is a more recent Google Webmaster Help video from August 2011 saying that Google still does not treat underscores as word separators. You may as well make life as easy as possible for the search engines, for the same reason that you give them valid HTML.

If you are starting a new site, you are definitely better off using dashes.

share|improve this answer

Here is your answer:

this url

share|improve this answer
Real-world proof. Nicely done. – Grant Palin Jul 9 '10 at 6:27
I don't really see this as "proof". Yes, you can assume the Stack guys probably know SEO, but it may be the choice of hyphens in the URL rewriting engine was arbitrary or chosen for some other reason. We don't know and therefore this answer is nothing more than speculation. – Dan Diplo Aug 5 '10 at 16:01
@Dan SO gets about 85% of its traffic from google (or so I recall from a blog post I saw) and I have searched for programming related info and found SO pages that were only minutes old. So I think we can say the that Stack guys know a thing or 2 about SEO – Sruly Aug 5 '10 at 16:40
Sorry, but it's a logical fallacy to say "Stack is highly ranked with Google and Stack uses hyphens in URLs therefore hyphens in URLs are better for SEO". There is no proven causal link. The main reason Stack ranks high on Google is that it's a very popular website and Google knows this. – Dan Diplo Aug 5 '10 at 19:21
Although Dan is technically right, all this "proof" discussion is really detracting from the elegance of the answer. – Fletch Aug 8 '12 at 14:10

This article by Jeff Atwood always clinched it for me: Of Spaces, Underscores and Dashes:

This_is_a_single_word, but this-is-multiple-words.

... though this no longer seems to hold in the case of Google (try searching for "web-site": it is considered as one word).

share|improve this answer
I understand and agree with the view point. However, I personally prefer the underscore as a separator for readability reasons. That's why I've switched to using underscores as separators in my delicious tags. – George Marian Aug 5 '10 at 20:23
I have several websites that use underscores but never dashes and all the major search engines seem to recognize them OK. Really I don't know why I started doing that other than the fact hyphens tend to word wrap when underscores don't. – Talvi Watia Sep 17 '10 at 8:00

Another downside of underscores is they will be invisible in some browsers when the entire URL is rendered as a link with an underline, which may be confusing if the user attempts to use the URL without copying and pasting (e.g. writing it down or reading it out).

share|improve this answer
Unfortunately, this doesn't answer the question (which refers specifically to search engines), although I actually think it's the most useful answer here! – Bobby Jack Aug 5 '10 at 17:08
This is true, but when you do have the underline, it looks just as good as a space! (without canonizing effects) – Talvi Watia Sep 17 '10 at 8:01
This was the original reason from years ago for not using underlines. – Rob Jun 23 '13 at 12:43

I think hyphens are easier to read, and it's what is in use the most (so your users will expect the URL to contain hyphens).

share|improve this answer

I believe hyphens will do better on search engines, since they are used as word separators. Plus they are a little easier for users to read.

share|improve this answer

I personally think dashes are easier to type than underscores because you don't need to press shift to get them. I'm also wondering if many people would even know where to find the underscore on the keyboard.

Of course, this isn't a big deal because most users are not typing in website addresses, but it's possible someone might be at sometime.

share|improve this answer

I'm all for hyphens. Using underscores for a multi-word phrase makes sense too. Hyphens are a tad quicker to type because you don't have to hit the shift. It may end up being a preference thing, but with the end user in mind, if hyphens are easier to read, then use em.

share|improve this answer
From an SEO perspective hyphens are better then underscores as they are word delimiters and underscores are not – John Conde Mar 10 '11 at 15:41

For me, it's easier to read hyphens than underscores. I think it's probably easier for most other people too.

Hyphens are treated as word dividers, which help your page names be seen as real words, which is a good thing.

Underscores, in many, if not most, cases are not treated as word dividers, which renders a page name as a big cluster of letters and underscores.

This means that -- all other things being equal -- your pages will score lower in most places if you use underscores rather than hyphens in your pages names. How much lower? Not much. Will this always be the case? No.

share|improve this answer

Lots of good answers here. Another point that should be added is that the pixel-width of a hyphen is smaller than an underscore, which may allow you to get another keyword into the SERP.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.