ForHosting KIT · Text & AI

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
Use it from WebAPIEmailTelegramApp soon
If you enter
Text
Hello World Example
You get
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.

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.

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.

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.

POSThttps://api.kit.forhosting.com/str/kebab-case

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.

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"}'
{
  "text": "Hello World Example"
}
{
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_chars100000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

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.

Unit tests for string formatters

Generate known-good kebab-case fixtures and assert blank input raises invalid_input in CI.

Read the full KIT documentation →