Skip to content
Free Tool Arena

Text & Writing Utilities · Free tool

Kebab Case Converter

Convert any text to kebab-case (dash-separated) or from kebab-case back to words. Includes slug-safe normalization.

Updated June 2026
To kebab-case
From kebab-case
Found this useful?EmailBuy Me a Coffee

Advertisement

What it does

kebab-case (dash-separated lowercase, named after how it looks like words skewered on a kebab stick) is one of the four main case conventions in programming: camelCase (first-word-lowercase, subsequent-capitalized: getUserName), PascalCase (all-words- capitalized: GetUserName), snake_case (under score-separated lowercase: get_user_name), and kebab-case (dash-separated lowercase: get-user-name). Each has its conventional domain. URLs and routing slugs use kebab-case (twitter.com/user-name, not /userName or /user_name) because dashes are URL-safe and improve readability. CSS properties use kebab-case (background-color, font-size). HTML attributes use kebab-case (data-user-id). File names in many projects use kebab-case for consistency.

The converter handles both directions: words/sentences/camelCase/snake_case → kebab- case, and kebab-case → space-separated words for human reading. The forward conversion handles edge cases that catch naive implementations: camelCase boundaries (split at lowercase-then-uppercase), consecutive-capitals (ParseHTMLDocument → parse-html-document, not parse-h-t-m-l- document), special characters (replace with dashes or strip based on slug-safe mode), unicode (transliterate accented characters: café → cafe), and consecutive-separators (multiple-spaces → single-dash). Reverse conversion is simpler — just split on dashes, capitalize first letter of each word.

Slug-safe mode (URL-friendly) goes further: strip non-alphanumeric characters entirely (keeps only letters, digits, and dashes), collapse multiple consecutive dashes, trim leading/trailing dashes, lowercase everything, transliterate accented or non-Latin characters where possible. Output is guaranteed safe for use in URLs, file names, and most database identifiers. For internationalized URLs, modern browsers accept Unicode-IDN slugs (e.g., café-paris) but compatibility varies — slug-safe ASCII remains the safer default.

Embed this tool on your siteShow snippet

Paste this snippet into any page. Loads on-demand (lazy), no tracking scripts, and sized to most dashboards. Replace the height to fit your layout.

<iframe src="https://freetoolarena.com/embed/kebab-case-converter" width="100%" height="720" frameborder="0" loading="lazy" title="Kebab Case Converter" style="border:1px solid #e2e8f0;border-radius:12px;max-width:720px;"></iframe>
Embed docs →

How to use it

  1. Paste your text or identifier into the input.
  2. Pick direction: to-kebab-case (most common) or from-kebab-case-to-words.
  3. Optionally enable slug-safe mode for URL-friendly output (strips special chars, normalizes Unicode).
  4. Click Convert and copy the result.
  5. For batch conversion of many strings, paste line-separated; tool processes each line.

When to use this tool

  • Generating URL slugs from blog post titles or product names.
  • Converting variable names between languages with different conventions (Java camelCase → CSS kebab-case).
  • Naming files consistently in a project that uses kebab-case for filenames.
  • Building URL-safe identifiers from arbitrary user-provided text.
  • Refactoring code from one case convention to another.

When not to use it

  • Languages or contexts where kebab-case isn&apos;t accepted — JavaScript variable names can&apos;t contain dashes (use camelCase or snake_case).
  • Database column naming where snake_case is the SQL standard convention.
  • Class names in most languages — those use PascalCase by convention.
  • Strict-encoding identifiers (some legacy systems require alphanumeric only, no dashes).

Common use cases

  • Quick conversion during a typical workday
  • Pre-decision sanity-check on inputs and outputs
  • Educational use &mdash; demonstrating the underlying concept
  • Onboarding a colleague who needs the same calculation/conversion

Frequently asked questions

Where is kebab-case used?
URL paths and slugs (twitter.com/john-smith), CSS properties (background-color, font-size), HTML attributes (data-user-id), CLI flags (--max-file-size), Lisp/Clojure variable names (this-is-clojure-style), filename conventions in many JS / web projects (component-name.tsx). Avoided in: JavaScript identifiers (dashes are subtraction operators), Python identifiers (PEP 8 uses snake_case), Java/C# class names (PascalCase).
How does it handle camelCase?
Splits at lowercase-then-uppercase boundaries: getUserName → get-user-name. Handles consecutive capitals correctly: ParseHTMLDocument → parse-html-document (not parse-h-t-m-l-document). Acronyms get treated as words. ID becomes id, URL becomes url, NASA becomes nasa, regardless of input casing.
What's the difference from snake_case?
Just the separator — kebab uses dashes (-), snake uses underscores (_). Functionally similar; conventional domains differ. Kebab dominates URLs and CSS; snake dominates Python/Ruby/SQL identifiers. Languages that allow dashes in identifiers (Lisp, Clojure) prefer kebab. Languages that don&apos;t (most others) use snake or camel.
How does slug-safe mode handle special characters?
Strips most non-alphanumeric characters (replaces with dashes or removes entirely depending on context). Transliterates Latin-1 accented characters to ASCII equivalents (é → e, ñ → n, ü → u, ç → c). Collapses multiple consecutive dashes into one. Trims leading/trailing dashes. Output is URL-safe ASCII suitable for / paths and filenames. For Unicode-rich text (Chinese, Arabic, Hebrew), slug generation is harder; some sites use transliteration libraries; others accept Unicode IDN slugs.
How long should slugs be?
SEO best practice: under 60 characters typical, ideally 3-5 keywords. Search engines display 50-60 characters of URL in results; longer URLs get truncated. Many CMSes auto-trim slugs to a reasonable length. Don&apos;t cram every word from a long title into the slug — pick the 3-5 most-relevant keywords.
Can I round-trip kebab → words → kebab?
Mostly yes for simple cases (&ldquo;hello-world&rdquo; → &ldquo;Hello World&rdquo; → &ldquo;hello-world&rdquo;). But information is lost for cases like consecutive capitals (&ldquo;parse-html-document&rdquo; → &ldquo;Parse Html Document&rdquo; → &ldquo;parse-html-document&rdquo; vs &ldquo;ParseHTMLDocument&rdquo; → &ldquo;Parse HTML Document&rdquo; → &ldquo;parse-html-document&rdquo;) — both round-trip to the same kebab but the original casing differs. For lossless round-trip, store original input separately.

Advertisement

Learn more

Explore more text & writing utilities tools

100% in-browserNo downloadsNo sign-upMalware-freeHow we keep this safe →

Found this useful?

The tools stay free thanks to readers who chip in or spread the word.

Buy Me a Coffee