U.UtilityApp
✍️ TextFree · No signup

kebab-case Converter

Convert text into kebab-case — ideal for URLs, CSS classes and slugs.

From any naming style to hyphens

The converter recognises words separated by spaces, underscores, existing hyphens or line breaks, plus camelCase humps where a small letter is followed by a capital. It lowercases everything and joins the words with one hyphen each. Doubled hyphens and hyphens at either end disappear.

Inputkebab-case
mainNavBarmain-nav-bar
snake_case_namesnake-case-name
user IDuser-id
10 Tips for SEO10-tips-for-seo
--leading-dashleading-dash

That makes it quick for turning a JavaScript property such as backgroundColor into its CSS name, background-color, or a component name into a file name.

Check before you use it as a URL

This is a case converter, not a slug generator. It doesn't remove punctuation or accents, and some of what it leaves causes real problems in a web address:

InputOutputProblem in a URL
Is Active?is-active?A ? starts the query string, so the page path ends at is-active
How to Bake Bread (Easy)how-to-bake-bread-(easy)Brackets are allowed but look odd and are often encoded
Über Cool Größeüber-cool-größeAccented letters are percent-encoded when the link is copied
Hello, Worldhello,-worldA stray comma in the path

For blog post and page addresses, remove the punctuation first, or use a slug tool that strips it and converts accented letters for you.

CSS class names and command-line flags

Kebab-case is the normal style for CSS classes, HTML data attributes and custom properties. Two things to watch:

  • A class name can't start with a digit unless it is escaped in the stylesheet, so 10-tips-for-seo works as a URL but not as a plain class selector. Put a word in front.
  • Leading hyphens are removed. Typing --leading-dash gives leading-dash, so if you are naming a command-line flag or a CSS custom property, add the -- back after converting.

Acronyms are lowercased and stay joined to the following word when there's no lowercase letter between them: XMLHttpRequest becomes xmlhttp-request.

Converting a list

Line breaks are separators, so a pasted list comes out as one long name, with Home Page and About Us on two lines giving home-page-about-us. To convert several names at once, put them on one line separated by a comma or a slash, both of which are kept, then split the output: Home Page/About Us gives home-page/about-us.

Frequently asked questions

Why is it called kebab-case?+

The words sit on the hyphens like pieces of food on a skewer. You will also see it called dash-case, hyphen-case or spinal-case, and lisp-case after the programming language family that uses it.

Is kebab-case good for SEO-friendly URLs?+

Hyphens are the usual way to separate words in a URL path, so the format suits it. What matters more is that the slug is short, readable and free of punctuation, so tidy the words before converting.

Can I use kebab-case for variable names?+

Not in most programming languages, where a hyphen means minus, so user-id would be read as user minus id. Use the camelCase or snake_case converter for code, and keep kebab-case for CSS, URLs, file names and config keys that allow it.

Embed this tool on your website

Free to use on blogs, school sites and intranets. Paste this code into your page's HTML; please keep the credit line.

<iframe src="https://utilityapp.lat/embed/text/kebab-case-converter" title="kebab-case Converter" width="100%" height="600" style="border:0;max-width:760px" loading="lazy"></iframe>
<p style="font-size:13px"><a href="https://utilityapp.lat/text/kebab-case-converter">kebab-case Converter</a> by UtilityApp</p>