kebab-case Converter

Convert camelCase, snake_case or plain text to kebab-case (dash-case) for CSS classes, URLs and file names. Handles acronyms and digits, line by line.

Example: userAccountId → user-account-id

Output

Each line is converted separately. Words are split at spaces, punctuation, _ - . / and camelCase boundaries; acronyms such as XML stay together and digits stay attached to the previous word.

Related Tools

View All

What is kebab-case?

This tool converts identifiers and phrases to kebab-case (also called dash-case): lowercase words joined by hyphens, used for CSS classes, HTML attributes, CLI flags and URL paths.

How to use kebab-case

  1. Type or paste text into the Input box – one identifier or phrase per line (or click Load sample).
  2. The converted text appears instantly in the Output box.
  3. Click Copy to copy the result.

Example

Input
getHTTPResponseCode
Output
get-http-response-code

When to use kebab-case

Use it for CSS class names, component file names or command-line options. For SEO URLs from titles with accents, a slug generator that removes diacritics is the better choice.

How kebab-case works

The input is split into words, every word is lower-cased and the words are joined with -. Words are split at spaces, punctuation and the separators _ - . /, and at case changes inside identifiers: fooBar → foo + Bar, and an acronym run is kept together (XMLHttpRequest → XML + Http + Request). Digits stay attached to the word before them (Request2Go → Request2 + Go), apostrophes inside words are dropped (don't → dont), and letters of any script (é, ñ, Cyrillic, Greek…) are supported. Every line is converted separately.

Common Use Cases

  • Creating CSS class names from component names
  • Converting React component names to file names
  • Generating CLI option names
  • Building URL path segments from identifiers

Security Note

Everything runs locally in your browser; the code you paste is not uploaded.

FAQs

Is kebab-case the same as a slug?

Similar, but this tool keeps accented letters; slug generators usually transliterate them to ASCII.

How are acronyms handled?

getHTTPResponseCode becomes get-http-response-code.

Does it work with multiple lines?

Yes, each line is converted separately.

Explore more categories