Kebab-case converter
Hello World Example becomes hello-world-example, and getUserId becomes get-user-id. Spaces, underscores and punctuation all collapse into single hyphens, so you never end up with doubled dashes. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Text
- Hello World Example
- Result
- hello-world-example
- Input
- Hello World Example
- Kebab
- hello-world-example
- Kebab case
- hello-world-example
lowercase words joined with hyphens, free
What kebab-case means and how words are split
Kebab-case is the naming style that writes multi-word identifiers in all lowercase letters with a single hyphen between each word: hello-world, user-profile-settings, convert-to-kebab-case. It is the conventional form for CSS class names, many HTML custom attributes, npm-style package names, and human-readable URL path segments when you want hyphens rather than underscores. This converter builds that form from free text.
Remaining input is split into tokens: runs of spaces, underscores, hyphens, and other non-alphanumeric characters act as separators; camelCase and PascalCase boundaries insert an extra break so getUserId becomes get, user, and id rather than one opaque token. Each token is lowercased and empty segments are dropped, then tokens are joined with a single hyphen so repeated separators never produce double hyphens. Pure punctuation with no letters or digits also fails validation, because there would be nothing left to join.
Practical tips, limits, and when to use this tool
Use this capability when the search intent is convert to kebab-case, make hyphen-case, or turn a phrase into lowercase words joined by hyphens. Keep intentional non-ASCII identifiers in mind: only ASCII letters and digits remain inside tokens, so characters outside that set act as separators rather than being transliterated—if you need full Unicode slugification with diacritic stripping, prefer a dedicated URL slug tool.
This landing is not a title-case converter that capitalizes major words for headlines, not a sentence-case formatter, and not a full SEO slug service with locale-specific transliteration tables. Prefer a title-case tool when humans will read the string as a headline; prefer this capability when machines will treat the string as a hyphenated identifier.
What you can do with it
CSS class and design-token naming
Turn component or token labels into stable kebab-case class names before generating stylesheets or design-system docs.
Route and data-attribute identifiers
Normalize mixed-case product or page titles into hyphenated path segments and data-testid values.
FAQ
What is kebab-case?
Kebab-case writes multi-word identifiers in lowercase with a single hyphen between words, for example hello-world or user-profile-settings.
How are words split?
Whitespace, underscores, hyphens, and other non-alphanumeric runs separate words. camelCase and PascalCase boundaries also insert breaks before lowercasing and joining.
What happens on empty input?
Input with no letters or digits after splitting also fails validation.
Is this the same as a URL slug generator?
Related but not identical. This tool focuses on lowercase hyphenated tokens from a phrase. Dedicated slug tools may also strip diacritics or apply locale transliteration rules.
Is the kebab-case converter free?
The browser tool is free and runs locally.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/str/kebab-case \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Hello World Example"}'const res = await fetch("https://api.kit.forhosting.com/str/kebab-case", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"text": "Hello World Example"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/str/kebab-case",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"text": "Hello World Example"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/str/kebab-case", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"text":"Hello World Example"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"text":"Hello World Example"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/str/kebab-case", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"text": "Hello World Example"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "str.kebab_case",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_chars | 100000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
A kebab-case converter turns a plain phrase into a lowercase, hyphen-separated identifier that CSS classes, HTML data attributes, package names, and many API path segments expect. Enter any non-empty string—titles, camelCase identifiers, snake_case fields, or multi-word labels—and the tool returns a deterministic kebab-case result with words lowercased and joined by single hyphens. Empty or whitespace-only input is rejected with a clear invalid_input error so pipelines never treat a blank string as a successful conversion.
What kebab-case means and how words are split
Leading and trailing whitespace is trimmed first; if nothing remains, the call fails with invalid_input instead of returning an empty success string.
How to call the API and what the response contains
Prefer sending the raw phrase rather than pre-hyphenating by hand when you want the fixed rule set; the converter collapses mixed separators and case styles into one normalized form. Send a JSON body with a required string field text (aliases input, value, string, s, and phrase). The value must be a non-empty string after whitespace is trimmed and must not exceed one hundred thousand characters so a single request cannot exhaust Worker or browser memory on huge paste dumps. On success the response echoes input as the original string you sent, text as the trimmed working string, result as the kebab-case output, kebab and kebab_case as the same string under alternate names for callers that prefer those keys, word_count as the number of tokens after splitting and filtering, and message as a short English summary that reports how many words were converted. Failed validation—missing text, a non-string value, an oversize payload, empty content after trim, or input with no alphanumeric characters—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item and zero marginal unit price.
Practical tips, limits, and when to use this tool
Paste a component name, a heading, or a legacy snake_case field, convert once, and drop the result into a CSS module class, a data-testid attribute, or a route segment. Round-trip checks for tests are easy: feed Hello World Example and expect hello-world-example with word_count three; feed getUserId and expect get-user-id; deliberately send empty string or spaces to confirm invalid_input and the message that asks for a non-empty string. Failed tasks that return invalid_input do not consume prepaid balance, which keeps form validation and CI negative tests cheap. When teaching naming conventions, compare the same phrase as camelCase, snake_case, and kebab-case so students see why front-end and CSS ecosystems standardize on hyphens rather than capital letters or underscores.
Integration use cases
Unit tests for string formatters
Generate known-good kebab-case fixtures and assert blank input raises invalid_input in CI.