Input
Output
kebab-case output appears here.
When to use kebab-case
Kebab-case is the standard for anything living in HTML or URLs — CSS class names, HTML attributes, URL slugs, and npm package names. It is human-readable in links and renders safely in all browsers. When naming React component files, some projects prefer MyComponent.tsx (PascalCase) while others use my-component.tsx (kebab-case) — choose one convention and be consistent.
Conversion examples
getUserProfile→get-user-profileuser_profile_data→user-profile-dataMy Component Name→my-component-name
Frequently asked questions
Where is kebab-case used?
CSS class names, HTML data attributes, URL slugs, npm package names, Angular component selectors, and file names in web projects.
Why can't kebab-case be used in JavaScript?
The hyphen is the subtraction operator in JS — my-variable is parsed as my minus variable. Use camelCase for JS identifiers.
Is kebab-case the same as lisp-case?
Yes — identical convention (lowercase + hyphens). "Lisp-case" is the older term; "kebab-case" is the modern web term.