Skip to content
Jellykit

Kebab Case Converter

Join words with hyphens in lowercase kebab-case, the form used by CSS classes, HTML attributes and file names.

  • Runs on your device
Loading tool

About Kebab Case Converter

CSS class names, custom HTML elements, command-line flags and many file names are written in kebab-case: lowercase words joined by hyphens. Paste "Primary Button Large" or primaryButtonLarge and get primary-button-large.

Each line is converted on its own. Accented letters are kept rather than replaced; if the result is going into a web address, the slug generator is the better choice, because it also turns accents into plain letters and trims length.

How it works

  1. For writing styles, the text is recased in place: spacing, punctuation and line breaks are untouched.
  2. For programming styles, each line is split into words at spaces, punctuation and existing capital-letter boundaries, then rejoined in the chosen convention.
  3. Title Case keeps short joining words such as "of", "and" and "the" lowercase unless they start or end the line.

Questions

How is this different from a URL slug?

kebab-case keeps every letter as it is apart from its case, including accents and non-Latin letters. A slug for a web address usually wants plain ASCII, which the slug generator produces by removing accents and other marks.

Does it split camelCase and PascalCase names?

Yes. A new word starts at each change from a small letter to a capital, so "backgroundColor" becomes background-color, which is handy for moving style names from JavaScript to CSS.

What happens to punctuation?

It is treated as a word break and collapsed with any spaces around it into a single hyphen. Apostrophes are removed without a break, so "don’t stop" becomes dont-stop.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.