kebab-case Converter Online
Convert any text to kebab-case format instantly in your browser. This free tool runs entirely client-side — your text never leaves your device.
Text Case Converter
Convert text between camelCase, snake_case, kebab-case, and more. Results update as you type.
About Case Conversion
- Automatically detects word boundaries from camelCase, separators (hyphens, underscores, dots, slashes), and whitespace.
- Supports 11 case styles commonly used in programming, CSS, file paths, and documentation.
- Everything runs in your browser — no data is sent over the network.
What is kebab-case?
kebab-case is a naming convention where multi-word identifiers are written in all lowercase with words separated by hyphens. For example, "user first name" becomes "user-first-name". The name comes from the visual resemblance to food items on a skewer. It is also known as spinal-case, param-case, or lisp-case.
Where is kebab-case used?
kebab-case is the standard convention for URL slugs, CSS class names, HTML attributes, and file names in web development. Frameworks like Angular and Vue use kebab-case for component selectors. It is also required for npm package names, custom HTML element names, and CSS custom properties (variables).
// JavaScript — convert string to kebab-case
function toKebabCase(str) {
return str
.replace(/([A-Z])/g, '-$1')
.replace(/[_\s]+/g, '-')
.toLowerCase()
.replace(/^-/, '');
}
toKebabCase('userFirstName'); // 'user-first-name'
toKebabCase('user_first_name'); // 'user-first-name'
# Python — convert string to kebab-case
import re
def to_kebab_case(s):
s = re.sub(r'(?<!^)(?=[A-Z])', '-', s)
return re.sub(r'[_\s]+', '-', s).lower()
to_kebab_case('userFirstName') # 'user-first-name'Frequently Asked Questions
Why is kebab-case preferred for URLs?
Search engines like Google treat hyphens as word separators, so kebab-case URLs are better for SEO. The URL /user-profile-settings is parsed as three separate words, while /user_profile_settings or /userProfileSettings may not be split correctly.
Can I use kebab-case for JavaScript variable names?
No. JavaScript identifiers cannot contain hyphens because the minus sign is an operator. Use camelCase for JS variables. Kebab-case is used for CSS classes, HTML attributes, URL paths, and file names in JavaScript projects.
Related Convert Tools
OpenAPI to TypeScript
Convert OpenAPI 3.x and Swagger 2.0 specs to TypeScript interfaces and types with $ref resolution, allOf/oneOf/anyOf, enums, and API operation types
JSON to Zod Converter
Convert JSON or JSON Schema to Zod validation schemas with $ref resolution, allOf/oneOf/anyOf, enum, format constraints, and required/optional fields
GraphQL to TypeScript
Convert GraphQL SDL schemas to TypeScript interfaces, types, enums, unions, and operations
TypeScript to JavaScript
Convert TypeScript to JavaScript — strip types, interfaces, enums, generics, and access modifiers to get clean JS output