Developer utility

kebab-case converter

Paste any text below to convert it to kebab-case — the standard format for CSS class names, URL slugs, HTML attributes, npm package names, and CLI flags. Handles camelCase, snake_case, and mixed input.

Type to see conversion

How kebab-case works

kebab-case joins multiple words into a single string using hyphens as the separator, with every letter in lowercase. Examples: first-name, user-profile-id, my-app-component, how-to-use-git. The name comes from the visual of words skewered together on a kebab stick.

The key structural fact about kebab-case: hyphens are not valid in most programming-language identifiers. You can't name a variable first-name in Python, JavaScript, or Java — the parser would read it as subtraction. That is why kebab-case lives in places that are adjacent to code rather than inside it: URLs, HTML attributes, CSS class names, filenames, and configuration keys.

This tool normalizes the input first — it splits on spaces, underscores, existing hyphens, dots, slashes, and case transitions — then rejoins with hyphens and lowercases everything. Paste firstName, first_name, First Name, or FIRST_NAME and you'll get first-name.

When to use kebab-case

kebab-case is the right choice whenever you're writing something hyphen-friendly that is also readable to humans:

  • URL slugs — Google officially recommends hyphens over underscores. A URL like /how-to-use-git is better for SEO and more readable than /how_to_use_git or /howToUseGit.
  • CSS class names.btn-primary, .nav-link-active. The BEM methodology (.block__element--modifier) is built on kebab-case.
  • HTML custom elements and attributes — custom elements must contain at least one hyphen (<my-component>). data-* attributes also follow kebab.
  • npm package namesreact-router, lodash-es, styled-components.
  • CLI flags--dry-run, --no-cache, --max-old-space-size.
  • Git branch names — most teams prefer feature/add-user-settings over feature/addUserSettings because hyphens are more scannable.

Need the identifier-friendly variants? camelCase converter for JavaScript and Java, snake_case converter for Python and Ruby. For the full guide to crafting search-friendly URLs, read SEO-friendly URL slugs.

Frequently asked questions

What is kebab-case?

A naming convention where words are joined with hyphens and every letter is lowercase. Examples: first-name, user-profile-id. It is the standard for CSS classes, URL slugs, HTML attributes, and npm package names.

What is the difference between kebab-case and snake_case?

They differ only in separator: kebab-case uses hyphens, snake_case uses underscores. Hyphens are invalid in most programming-language identifiers, so kebab-case is used outside of code (URLs, HTML, CSS) while snake_case is used inside code (Python, Ruby, Rust).

Why is kebab-case the standard for URL slugs?

Hyphens are universally treated as word separators by search engines and humans. Google officially recommends hyphens over underscores in URLs. A URL like /how-to-use-git ranks better and reads better than /how_to_use_git.

Does this tool send my text to a server?

No. Conversion happens entirely in your browser. Nothing you paste leaves your device.