Text case guide
Convert text to kebab-case
kebab-case joins lowercase words with hyphens. It is useful for slugs, filenames, routes, and readable identifiers.
Where kebab-case helps
Spaces and mixed capitalization are awkward in filenames, routes, and slugs. kebab-case makes a phrase easier to scan and easier to paste into systems that prefer simple separators.
Example
User Profile Image
user-profile-image
How to convert a phrase
- Paste the phrase into the Text Case Converter.
- Choose kebab-case as the target style.
- Review punctuation and acronyms before using the result as a slug or filename.
Good slugs stay predictable
A good kebab-case slug is short, lowercase, and readable without punctuation. It should be easy to say out loud and easy to compare in a list of routes or filenames.
If the slug is already public, changing it is a URL change, not just a text cleanup. Keep the old path working or add a redirect.
Common mistakes
- Using kebab-case for JavaScript variable names
- Forgetting to URL encode a slug when it still contains unsafe characters
- Leaving duplicate separators after removing punctuation
- Changing a public URL slug without setting redirects
Related problems
FAQ
Is kebab-case good for URLs?
Yes, simple lowercase hyphenated slugs are readable and common in URLs.
Is kebab-case valid for JavaScript variables?
No. Hyphens are treated as minus signs in JavaScript identifiers. Use camelCase for variables.
Should I encode kebab-case text for a URL?
If it only contains lowercase letters, numbers, and hyphens, it usually does not need extra encoding.