Convert text into kebab-case — the standard for URL slugs, CSS class names and HTML attributes.
Convert text into kebab-case for URLs, CSS classes and file names. Free online developer tool.
kebab-case Converter examples
Input
Output
User First Name
user-first-name
héllo Wörld
héllo-wörld
How the kebab-case converter works
Words are detected at spaces, punctuation and camelCase boundaries.
Each word is lowercased and joined with hyphens.
Ideal for CSS class names, file names and URL fragments.
Rules and edge cases
Words are split at spaces, underscores, dots, punctuation and camelCase boundaries, then joined with single hyphens.
Everything is lowercased, so BlogPost Title becomes blog-post-title — the form URLs and CSS class names expect.
Leading and trailing hyphens are trimmed, and consecutive separators never produce a double hyphen.
Unicode letters are kept as-is. For URL slugs where ASCII matters, use the slug generator instead — it transliterates é to e and ø to o.
snake_case is the same split with underscores; the slug generator additionally strips accents and non-ASCII characters for clean URLs.
Frequently asked questions
Is kebab-case safe in a URL?
Hyphens are the separator Google recommends for URLs. Accented characters are legal but get percent-encoded, so use the slug generator when you want a pure ASCII path.
Why can't I use kebab-case for variable names?
Most languages read the hyphen as a minus sign, so kebab-case is used for files, CSS classes, HTML attributes and URLs — not identifiers. Lisp and Clojure are the notable exceptions.