Should We Use Underscores or Hyphens in URLs?

November 17, 2009 · Filed Under CMS, Ingeniux, Redesign, SEO, Search · Comment 

As part of our implementation of Ingeniux CMS, we’ve had to decide how we want URLs to read (i.e., how will the page name read in a browser’s address bar).

Out of the box, Ingeniux displays page URLs as numbers with an .xml extension (e.g., 345.xml). Although, this method is short and clean, numbers aren’t real memorable. It’s much easier for site visitors to remember academics.html or news.html than 345.xml. You have some inclination where academics.html will take you when clicked, whereas 345.xml is pretty vague.

To present more human-readable URLs, Ingeniux allows us to utilize structured URLs using a hyphen or an underscore as a separator and specify .htm or .html as an extension. So which is better, hyphens or underscores? For me it has always come down to usability, something we touch on during each CMS training. It is much easier to read a Web address done in hyphens than underscores, especially when including URLs in print. If URLs appear as underlined text, the underscores are often harder to read.

When it comes down to it, search engines treat both underscores and hyphens differently. Google for example treats hyphens as separators or dividers while underscores are not treated as such as shown below.

Underscores vs. Hyphens

Example 1: www.anselm.edu/my_web_page.html
Example 2: www.anselm.edu/my-web-page.html

How Google reads these URLs.

Example 1: mywebpage
Example 2: my web page

Read more