Skip to main content
CaseSwitch

SEO

SEO URL Slugs: Why kebab-case Wins Over snake_case

By CaseSwitch Team · 2026-07-28 · 5 min read

Google treats hyphens and underscores differently. Learn the SEO best practices for formatting URL slugs and naming files.

When creating a new blog post or product page, you have to decide how to format the URL. Should it be /my-new-page (kebab-case) or /my_new_page (snake_case)? For Search Engine Optimization (SEO), the answer is definitively kebab-case.

How Google reads URLs

According to Google's official Search Central documentation, their crawlers treat hyphens (-) as word separators. If your URL is /blue-cotton-shirt, Google reads the keywords 'blue', 'cotton', and 'shirt'.

See Google's guidance on URL structure for more on how readable URLs help users and search engines.

Conversely, Google does not treat underscores (_) as word separators. If your URL is /blue_cotton_shirt, Google reads it as a single, combined word: 'bluecottonshirt'. This makes it significantly harder for the page to rank for the individual keywords.

What about CamelCase?

While some operating systems are case-insensitive, web servers like Apache and Nginx are typically case-sensitive. If you use /BlueCottonShirt, a user typing /bluecottonshirt will hit a 404 error unless you set up explicit redirects. Furthermore, capital letters in URLs are harder for users to read and type accurately. Stick to lowercase letters.

Best practices for URL Slugs

  • Use kebab-case: Separate all words with hyphens.
  • Keep it short: Remove 'stop words' (and, the, a, of) to make the URL memorable.
  • All lowercase: Force all characters to lowercase to prevent server routing errors.
  • Avoid special characters: Strip out commas, quotes, and emojis.

Use our kebab-case converter to instantly transform long article titles into SEO-friendly URL slugs.

Related articles