toolqik

171 · Text

Kebab Case Converter

Convert names and phrases to kebab-case for URLs, CSS classes and file names.

Runs in your browser
Options
Kebab Case

  

About this tool

kebab-case writes lowercase words joined by hyphens: user-profile-card. It’s the convention for CSS class names, HTML data- attributes and custom elements, URL paths, file names in many web projects, npm package names and command-line flags (--dry-run). Paste names in any style, one per line.

CaseExampleTypical use
camelCaseuserProfileIdJavaScript, Java and C# variables and functions; JSON keys
PascalCaseUserProfileIdClasses and types in most languages; C# methods; React components
snake_caseuser_profile_idPython, Ruby and Rust variables; database columns
kebab-caseuser-profile-idURLs, CSS classes, HTML attributes, file names, CLI flags
CONSTANT_CASEUSER_PROFILE_IDConstants and environment variables

How words are detected

Input can be in any style: spaces, snake_case, kebab-case, camelCase or PascalCase. Words are split at spaces, underscores, hyphens and other punctuation, at lowercase-to-uppercase changes (userId → user, Id), and at acronym boundaries (XMLHttpRequest → XML, Http, Request). Each line is converted separately, so you can paste a whole list of names at once. Letters with accents and non-Latin scripts are kept.

kebab-case vs. slugs

For identifiers in code, this converter keeps every word. For URLs made from page titles you usually also want accents transliterated (café → cafe), symbols like & spelled out and a length limit. The slug generator does all of that.

Train-Case capitalizes each word (Content-Type), the style of HTTP header names.

Note that most programming languages can’t use hyphens in variable names, because user-id reads as “user minus id”; use camelCase or snake_case there.

FAQ

What is kebab-case?

A naming style with lowercase words separated by hyphens, like user-profile-card. It is used for CSS classes, URLs and file names.

How do I convert camelCase to kebab-case?

Paste the names, one per line. userProfileCard becomes user-profile-card.

Why is it called kebab-case?

The hyphens look like a skewer through the words. It is also called dash-case, lisp-case or spinal-case.

What is Train-Case?

kebab-case with each word capitalized, like Content-Type. HTTP header names are written this way.

esc
↑↓ navigate↵ open