What this does
kebab-case lowercases words and joins them with hyphens: “Getting Started Guide” becomes getting-started-guide, and camelCase input like pageHeaderTitle becomes page-header-title. Type below and read the kebab-case row, it updates live.
kebab-case's home turf is the one place the other conventions cannot go: URLs, where search engines treat the hyphen as a word separator but the underscore as a word joiner, ten-tips indexes as two words, ten_tips as one token. The cost is symmetrical with snake_case: on our corpus's 244 unique keys, kebab-case averages 7.5 characters against camelCase's 7.2, one hyphen per word boundary.
kebab-case versus a URL slug
This row reuses the snake_case splitter, then turns every underscore into a hyphen. It lowercases, splits on an ASCII lowercase-or-digit followed by an uppercase letter, and replaces spaces and underscores. That is the whole job. pageHeaderTitle becomes page-header-title, data_user_id becomes data-user-id, aria-label stays aria-label, and “Getting Started Guide” becomes getting-started-guide.
A slug generator goes further: Unicode NFKD normalisation, stripping combining marks (é becomes e), mapping symbols such as & to words, and dropping everything outside a–z, 0–9 and the separator. This converter does none of that. café_menu becomes café-menu, 日本語_label becomes 日本語-label, and user.accountId becomes user.account-id. If the output has to be a public path, switch to the Slug Generator.
The same acronym and digit rules as snake_case apply: HTTPRequest becomes httprequest, parseJSON becomes parse-json, utf8String becomes utf8-string, v2APIClient becomes v2-apiclient, user2fa stays user2fa. Consecutive underscores become consecutive hyphens (user__account becomes user--account). A run of hyphens in the input is first collapsed by the snake_case pass, so user--account typed as input becomes user-account. Leading spaces become a leading hyphen. CSS custom properties typed as --main-color come out -main-color (one leading hyphen), which is not a valid custom property: keep the extra dash yourself or type main-color and add -- in the stylesheet.
HTTP header field names are kebab-case historically (Content-Type, Accept-Language) and lowercase kebab in HTTP/2 (content-type). Kubernetes labels prefer kebab-case or DNS subdomains. Next.js app-router folders, Eleventy permalinks and most static-site path segments are kebab-case. npm package names allow hyphens and forbid capitals. Stylelint’s selector-class-pattern and most design-system linters reject camelCase class names. None of those systems want camelCase in a public path.
Worth typing: onSubmit becomes on-submit, createdAt becomes created-at, getObjectOr404 becomes get-object-or-404, X-Request-Id becomes x-request-id, XMLHttpRequest becomes xmlhttp-request. HTTPRequest still collapses to httprequest. A finished BEM class such as card__title--large becomes card--title--large, which is why BEM should not go through this row.
When it goes wrong
kebab-case cannot be a variable name in most languages, because the hyphen parses as subtraction (page-header is page minus header), so if code is the destination you wanted the camelCase or snake_case row. This row is identifier conversion, not slug generation: accents stay (café_menu becomes café-menu), symbols stay, and dots stay (user.accountId becomes user.account-id). The Slug Generator is the tool that strips diacritics, maps “&” to “and”, and drops everything outside a–z, 0–9 and the separator. All-caps acronyms without a hump collapse: HTTPRequest becomes httprequest, not http-request.