WordCounter

kebab-case Converter

Convert any text, camelCase, PascalCase, or snake_case string into lowercase hyphenated kebab-case for URL slugs, CSS styles, and web components.

Active Mode: kebab-case
Chars: 0Words: 0Lines: 0
Primary Action: Convert to kebab-case
For URL slugs, CSS classes, and HTML attributes. (Example: hello-world)

Convert Text To:

12 Case Styles Available
Writing & Editorial Cases
Code & Developer Identifier Cases

Clean, SEO-Friendly kebab-case Converter for Developers & Creators

In modern web development and digital marketing, consistent naming conventions are critical for clean codebases and high search engine visibility. Our kebab-case converter transforms ordinary sentences, title-cased headlines, camelCase identifiers, or snake_case database columns into clean, lowercase hyphen-separated strings. Whether you are generating an SEO-friendly URL permalink, naming a CSS class selector, or defining custom HTML5 data attributes, this online utility formats your strings with 100% client-side privacy.

What is kebab-case? Anatomy and Origins

The term kebab-case gets its playful name from culinary shish kebabs: the horizontal hyphen (`-`) pierces through the center of lowercase words like a skewer. In computer science literature, it is also called spinal-case, hyphen-case, dash-case, or lisp-case (due to Lisp's historical support for hyphens in variable names).

Unlike camelCase or PascalCase, which rely on uppercase letter shifts, kebab-case preserves all characters in lowercase, preventing case-sensitivity bugs across different operating systems and web servers.

Why kebab-case Dominates Web Standards

Different languages and environments demand distinct casing conventions:

  • SEO URL Permalinks: Google’s official Search Central documentation explicitly recommends using hyphens (`-`) rather than underscores (`_`) to separate keywords in page addresses.
  • CSS & BEM Methodology: Standard CSS classes (`.site-header`, `.btn-primary-large`) utilize kebab-case because CSS syntax is case-insensitive.
  • HTML5 Data Attributes: Attributes like `data-user-id` and custom elements like `<weather-widget>` mandate hyphenated naming.
  • Package Registries: The npm registry for JavaScript libraries requires all published package names to be valid kebab-case.

Programming Casing Styles Comparison Guide

Case StyleVisual SyntaxPrimary Use CasesExample Output
kebab-caselowercase-with-hyphensURLs, CSS classes, HTML data attributes, npm packagesuser-account-details
camelCaselowercaseInitialCamelJavaScript / TypeScript variables, functions, JSON keysuserAccountDetails
PascalCaseUppercaseInitialCamelClasses, React components, TypeScript interfacesUserAccountDetails
snake_caselowercase_with_underscoresPython functions, SQL database columns, REST endpointsuser_account_details
SCREAMING_SNAKE_CASEUPPERCASE_WITH_UNDERSCORESGlobal constants, environment variables (.env files)USER_ACCOUNT_DETAILS

How to Convert Text to kebab-case

  1. Input Your Text: Paste your title, headline, or code identifier into the input area.
  2. Automatic Normalization: Our algorithm strips special punctuation, replaces spaces with hyphens, and splits camelCase word boundaries.
  3. Copy with 1-Click: Click the copy button to transfer your formatted kebab-case string into your code editor or CMS slug field.

Frequently Asked Questions

What is kebab-case and how does it work?

kebab-case (also referred to as dash-case, hyphen-case, spinal-case, or lisp-case) is a naming convention where all letters are converted to lowercase and individual words are joined by hyphens (`-`), e.g., `user-profile-card` or `submit-form-button`.

Where is kebab-case most commonly used in programming?

kebab-case is the industry standard for web page URL slugs (`/blog/how-to-write-code`), CSS class selectors (`.main-nav-container`), HTML custom data attributes (`data-user-id`), web components (`<custom-header>`), and npm package names.

Why do search engines prefer hyphens (kebab-case) over underscores in URLs?

Google, Bing, and other search engine web crawlers explicitly recommend hyphens over underscores in URLs because search algorithms treat hyphens as distinct word separators. Underscores are often indexed as a single combined compound token, harming SEO keyword discoverability.

How does this tool convert camelCase and PascalCase to kebab-case?

Our converter detects capital letter boundaries in camelCase (`myVariable`) and PascalCase (`UserProfile`) and inserts a hyphen before each uppercase character while converting all letters to lowercase (`my-variable` and `user-profile`).

How do you convert snake_case to kebab-case?

Converting snake_case to kebab-case simply replaces all underscore characters (`_`) with hyphens (`-`), turning `get_user_by_id` into `get-user-by-id`.