What is the kebab-case Converter?
kebab-case writes words in lowercase separated by hyphens: “Primary Button Large” becomes “primary-button-large”. The name comes from the words looking like pieces on a skewer.
It is used for CSS class names, HTML attributes, URL paths, npm package names, and file names in many web projects. This converter handles camelCase, PascalCase, snake_case and normal sentences, one per line.
How to use the kebab-case Converter
- Enter one phrase or name per line.
- Each line becomes kebab-case.
- Copy the result.
Examples
primaryButtonLarge
primary-button-large
My Blog Post Title
my-blog-post-title
When to use it
- CSS class names
- URL paths and slugs
- npm package and file names
- HTML data attributes
Frequently Asked Questions
What is kebab-case?
Lowercase words separated by hyphens, e.g. my-class-name.
Is kebab-case the same as a URL slug?
Very similar. For URLs from titles, the URL Slug Generator also removes apostrophes and handles accents for SEO.
Why can’t I use kebab-case for JavaScript variables?
The hyphen is the minus operator in JavaScript, so use camelCase for variables.