How To Convert Text To kebab-case

Learn what kebab-case is, why it suits URLs and CSS, and how to turn any phrase into a clean hyphenated slug.

3 min read Updated Jun 2026

Quick Answer

This kebab case converter (also called hyphen case, dash case, or slug case) lets you convert to kebab-case instantly, writing everything in lowercase and using a hyphen separator between words. As a url slug generator it will slugify text for URLs: "User Profile Image" becomes "user-profile-image". It is the standard for CSS class names, HTML IDs, URL slugs, file naming, and command-line flags.

Try The kebab-case Converter →

Where kebab-case Is Used

The web favors kebab-case: CSS selectors (.nav-item), custom properties (--color-primary), URL slugs, and filenames all read well with hyphens. To make a CSS-class-safe name, kebab-case is the natural fit, and for file naming it avoids spaces that break shell commands. Search engines also split hyphenated slugs into separate words, which helps readability and SEO, so turning a title into a URL slug is one of its most common jobs.

How The Conversion Works

The converter splits your text into words at spaces, underscores, punctuation, and camelCase humps, lowercases each word, and joins them with hyphens: producing a clean slug. For example: "getUserProfile", "get_user_profile", and "Get User Profile" all become "get-user-profile". Each line is converted on its own.

This tool is free and runs online entirely in your browser. Your text stays on your device, protecting your privacy: nothing is uploaded to a server, and results appear instantly.

Examples

A blog title to a slug. For example, "My First Blog Post" becomes "my-first-blog-post", ready to drop into a URL.

A component name to a CSS class. For example, "PrimaryButton" becomes "primary-button", a CSS-class-safe name with a hyphen separator between words.

kebab-case vs Other Naming Conventions

kebab-case is the standard for web-facing identifiers but has some specific limitations compared to alternatives. snake_case uses underscores instead of hyphens and is widely used in Python and SQL: it works as a variable name in any programming language. camelCase uses no separator and capitalises each word, making it the standard for JavaScript and Java variables. PascalCase is like camelCase but capitalises even the first letter, used for class names. Unlike these alternatives, kebab-case cannot be used for variable or function names in most languages because hyphens are interpreted as subtraction operators, so kebab-case stays in the domain of CSS, HTML, URLs, and filenames.

You May Also Need

You may also need

Next steps

Alternatives

Continue Learning