Convert text to kebab-case

kebab-case joins your words with dashes and lowercases everything. Paste User Profile Page and get user-profile-page. The format is standard for URL slugs, CSS class names, and HTML attribute names. For underscores instead of dashes, see snake_case; for capitalised words with dashes, see Train-Case.

Input
Line 1:1 LF cloud_done Saved locally
Result kebab-case
0 lines 0 chars

Identifiers for URLs, CSS, and HTML

kebab-case is the identifier style for URL slugs, CSS class names, HTML attribute names, and many command-line flags. User Profile Page becomes user-profile-page: every word lowercased, joined with single dashes. The dash is the only separator; no underscores, no spaces, no caps.

The engine first tokenises your input by replacing underscores and dashes with spaces, splitting on lowercase-to-uppercase transitions, lowercasing everything, and splitting on whitespace. The tokens are then joined with -. The result is a clean kebab-case identifier no matter how the input was formatted.

Where it shows up: URL slugs (/user-profile-page/), CSS class names (.btn-primary), CSS custom property names (--brand-color), HTML attribute names (data-user-id), Lisp/Clojure identifiers, and command-line flags (--user-profile). Pair with Train-Case for capitalised header style and snake_case for the underscore variant.

How to use convert text to kebab-case

  1. 1Paste or type your phrase into the input panel on the left.
  2. 2The kebab-case identifier appears in the output panel on the right as you type.
  3. 3Mixed input is fine: UserProfile, user_profile, and USER PROFILE all produce user-profile.
  4. 4Click Copy in the output header to paste the slug into your URL, CSS, or HTML.
  5. 5For underscores, use snake_case; for header-style dashes, use Train-Case.

Keyboard shortcuts

Drive TextResult without touching the mouse.

Shortcut Action
Ctrl FOpen the find & replace panel inside the input Plus
Ctrl ZUndo the last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor Plus
EscClose find & replace, or exit fullscreen
Ctrl KOpen the command palette to jump to any tool Plus
Ctrl SSave current workflow draft Plus
Ctrl PRun a saved workflow Plus

What this tool actually does

Word boundary detection

Same tokeniser as camelCase. Underscores, dashes, whitespace, and lowercase-to-uppercase transitions all count as word boundaries, so any input format produces a consistent kebab-case output.

Lowercase joining with dashes

Tokens are emitted in lowercase and joined with a single dash. USER PROFILE -> user-profile. For capitalised words with dashes (User-Profile), use Train-Case instead.

Already-formatted input round-trips

Pasting user-profile-page back in still produces user-profile-page. The tokeniser splits on the existing dashes, lowercases each token, and rejoins.

Multiple separators collapse

Runs of dashes, underscores, or spaces collapse to a single dash in the output. user---profile and user__profile both become user-profile.

URL-safe output (within reason)

Lowercase ASCII letters, digits, and dashes are URL-safe without encoding. The tokeniser does not strip punctuation or non-ASCII characters, so if your input contains those, run remove special characters first to get a clean slug.

Worked example

Spaces, camelCase boundaries, and shouty caps all collapse to the same kebab-case result. Digits stick to their word, so 4821 stays attached to order.

Input
User Profile Page
fetchUserById
ORDER 4821 details
Output
user-profile-page
fetch-user-by-id
order-4821-details

Settings reference

Input kebab-case output
user profile user-profile
user_profile user-profile
UserProfile user-profile (boundary via lower-to-upper split)
USER PROFILE user-profile
user---profile user-profile (runs collapse to single dash)
user2 profile user2-profile (digits stick to their word)

FAQ

Is kebab-case the same as a URL slug?
Close but not identical. A URL slug is usually kebab-case plus stripped punctuation and non-ASCII characters. This tool produces kebab-case from your tokens; for full slug normalisation, run the input through remove special characters first or remove accents if it has diacritics.
How is kebab-case different from snake_case?
kebab-case uses dashes (user-profile); snake_case uses underscores (user_profile). Both lowercase. Use kebab-case for URLs, CSS, and HTML; snake_case for Python and SQL.
Will it handle camelCase input?
Yes. The tokeniser splits on lowercase-to-uppercase transitions, so userProfileData produces user-profile-data.
How is kebab-case different from Train-Case?
kebab-case is all lowercase (user-profile); Train-Case capitalises every word (User-Profile). Both use dashes as separators. Train-Case is sometimes used for HTTP header names like Content-Type.
Will the output work in CSS class names?
Yes. CSS class names accept lowercase letters, digits, dashes, and underscores. The kebab-case output is a valid CSS class name as long as it does not start with a digit (rare in practice).