Kebab Case vs Camel Case in URLs
Last modified by Eleni Cojocariu on 2025/08/14 13:41
Comparisons
| Kebab Case | Spaces | Snake Case | Camel Case | |
|---|---|---|---|---|
| Recommended | Using hyphens is widely recommended as best practice because it improves the SEO. Search engines treat hyphens as word separators, making it easier to index individual keywords. It is recommended by several websites (Google, Stackoverflow) and preferred over Snake case. | Not recommended as a delimiter of words, since the URL doesn't look nice when sharing (it's replaced with %20). While URLs with spaces may appear correctly in some web browsers, relying on this is inconsistent, and makes URLs harder to read and less pleasant to share. | Underscores are considered part of a word, so search engines treat connected words as a single term, while hyphens separate words (so that a search engine can index the individual words). | Not recommended because it doesn’t help search engines index each word separately; the words remain concatenated. |
| Pros |
| Human-readable in plain text before encoding which can make the URL easier to interpret at first glance, and in some websites that don't convert the space into %20, it can remain visually clean when displayed. | - |
|
| Cons | Longer URLs when multiple words are used | Automatically encoded to `%20` in URLs; looks messy in links. It would be too risky to rely only on the fact that some browsers don’t convert it into `%20`. | It affects the SEO since words aren't split. |
|
Other best practices:
- Use lowercase letters.
- Eliminate stop words ('a', 'the', 'when', 'while', 'in').
Sources
- Snake Case.
- Kebab Case.
- Camel Case.
- Google recommends using hyphens.
- Stack overflow.
- Experience League Adobe.
- Metamug.
- Design Power.
PS: all the links listed above as sources use hyphen as delimiter.