Hyphens vs Underscores in URLs: Which One Wins for SEO?

You're naming a new page and your CMS or code editor is happy to accept either symbol. blue-widget-guide or blue_widget_guide — both look tidy, both render fine in a browser, and nothing about the interface warns you that one of them is quietly working against you in search results.

This isn't a stylistic coin flip. Google has been explicit about how it parses the two symbols differently, and that difference compounds across every page, image, and file name on a site that picked the wrong one by habit.

Quick Answer

Use hyphens, not underscores, in URL slugs. Google explicitly treats a hyphen as a word separator, so blue-widget is read as two words, while an underscore is ignored, so blue_widget is read as one word, "bluewidget." The fix is simple — replace underscores with hyphens sitewide and 301-redirect the old URLs so nothing breaks.

What's actually different between hyphens and underscores?

Both characters do the same visual job — they stand in for a space that a URL can't contain. The difference is entirely in how a crawler parses the string once it gets there.

The takeaway: this was never a taste preference between two similar-looking symbols. One of them helps a crawler extract keywords from your URL, and the other quietly prevents it.

Why this matters for SEO

A single mismatched separator won't sink a page, but the pattern adds up in ways that are easy to miss until they're pointed out:

📊 Quick stat Google has maintained the same public position on this since well before 2020: hyphens are a supported word separator in URLs, underscores are not — the guidance itself hasn't changed, only how many site owners have actually acted on it.

Step-by-step: auditing and fixing your slugs

  1. Pull a full list of your site's URLs. Export every published page, post, and image path from your CMS, sitemap, or crawler of choice.
  2. Scan the list for underscores, spaces, and uppercase letters. All three break the same word-separation rule in slightly different ways and should be flagged together.
  3. Generate the corrected hyphenated version of each slug. Replace every underscore with a hyphen and lowercase the whole path, keeping the wording itself unchanged.
  4. Set up a 301 redirect from each old URL to its new one. This is the step that actually protects existing rankings and backlinks — never rename a live URL without it.
  5. Update internal links to point at the new slugs directly. Redirects work, but linking straight to the final URL avoids an unnecessary hop for both users and crawlers.
  6. Resubmit the affected URLs in Search Console. This nudges Google to recrawl and re-index the corrected paths sooner rather than waiting for the next natural crawl.
  7. Set a naming rule going forward. Bake "hyphens only, always lowercase" into your CMS's slug settings or your team's publishing checklist so the mistake doesn't reappear on new pages.
Try the Rebrixe Slug Validator — free Paste in your full URL and flag every underscore, space, and uppercase slug in one pass.
Validate My URLs →

Common mistakes when fixing separators

1. Renaming the slug without a redirect

Changing blue_widget to blue-widget on the live URL with no 301 in place turns every existing link and bookmark into a dead end, and hands away whatever ranking signal the old page had built up.

2. Mixing both separators on the same site

Fixing new pages while leaving years of old underscored posts untouched creates an inconsistent pattern that's harder to reason about later than either convention applied uniformly.

3. Treating this as more important than it is

Separator choice is a small, indirect factor. Rewriting a site's entire URL structure at the expense of fixing actual content or technical issues gets the priority backwards.

4. Forgetting image and file URLs

Slug audits often stop at page URLs and skip product_photo.jpg-style image file names, which follow the exact same word-separation rule and matter for image search.

💡 Pro tip Fix separators in batches by section — blog, then products, then images — and redirect and verify each batch before moving to the next, rather than renaming the entire site at once.

Real-world examples

How the same page title turns into a working or a weakened URL, depending on the separator:

Blog post
Recipe roundup
/easy-weeknight-dinners
Reads as three distinct keywords instead of "easyweeknightdinners" as one unrecognized string.
Ecommerce
Product page
/mens-running-shoes
Keeps "running shoes" matchable as a real search phrase instead of merging it into one token.
Image asset
Photo file name
product-photo.jpg
Stays parsable for image search the same way a page slug would be.
Support doc
Help article
/reset-your-password
Matches how someone would actually type the same query into a search bar.

In every case, the words on the page didn't change — only whether the URL communicates those same words to a crawler.

Hyphens vs underscores compared

A direct look at how the two separators, plus the other common alternatives, actually behave in a URL.

Separator Read by Google as Human readability Recommended for URLs
Hyphen (-) Word boundary High Yes
Underscore (_) Part of the word High No
Space Encoded as %20 Low, breaks visually No
camelCase No clear boundary Moderate Not ideal

Check your URLs right now — free

The Rebrixe Bulk Slug Validator scans an entire list of URLs at once, flags every underscore, space, and uppercase character, and outputs the corrected hyphenated version of each one — ready to hand off for redirects. No account, no watermark.

Free Slug Validator Paste your URLs, get every broken separator flagged instantly.
Open Slug Validator →

Frequently asked questions

Yes. Google's own documentation states that hyphens are treated as word separators inside a URL, while underscores are not. A slug like blue_widget can be read as one word, "bluewidget," instead of two, which weakens any keyword-matching benefit the URL might otherwise give you.
Not directly. URL separator choice is a minor, indirect signal at most — it won't move a page from position 20 to position 1 on its own. The value comes from removing a small piece of friction so your existing content and keywords are read correctly, not from an algorithmic bonus for using hyphens.
Only if the change isn't handled correctly. Renaming a live URL without setting up a 301 redirect from the old underscore version to the new hyphenated one will produce broken links and lose any accumulated ranking signal for that page.
Spaces get encoded as %20 or a plus sign in a URL, which looks broken and is hard to read, so they should be avoided entirely. camelCase avoids symbols but removes the visual word boundary a separator provides, so it's harder for both users and crawlers to parse than a hyphenated slug.
Yes. Image file names are a URL just like a page slug, and Google's image search parses them the same way. A file named product_photo.jpg loses the word-separation benefit that product-photo.jpg keeps.
Underscores remain appropriate in places that aren't public-facing URLs, such as programming variable names, database column names, or internal file identifiers, where readability rules for search engines don't apply.
Run your list of URLs through a slug validator tool, which scans each one, flags any that use underscores, spaces, or uppercase letters, and shows the corrected hyphenated version you should redirect to instead.

Fix every mismatched slug in one pass

The Rebrixe Bulk Slug Validator scans your full URL list, flags underscores, spaces, and uppercase characters — no account, no watermark.

Launch the Slug Validator →
← Back to blogs