Converts a string to kebab-case: lowercase words joined by hyphens (foo-bar). Same word-splitting family as _.camelCase and _.snakeCase — only the join style differs. Part of Lodash String (stable — not deprecated).
Pass the string and options shown below. Check the return type before you chain another helper.
Syntax
Call _.kebabCase. Start with this line.
Lodash
_.kebabCase([string=''])
Call
What it does
_.kebabCase([string=''])
Primary signature.
_.kebabCase(string)
Transform or inspect a string.
Prefer import kebabCase from "lodash/kebabCase" when you want a smaller bundle.
_.kebabCase is a Lodash 4.x String helper. It runs anywhere Lodash runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash or lodash/kebabCase. There is no native kebabCase; DIY would split words and join with -.
✓ Stable · Lodash 4.x
_.kebabCase()
Available in [email protected] and lodash/kebabCase modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.
100%With Lodash 4.x
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
_.kebabCaseLodash 4.x
Bottom line: Safe for production. Ideal for URL slugs and CSS class names from mixed input.
Frequently Asked Questions
_.kebabCase([string='']) converts a string to kebab-case: lowercase words joined by hyphens. Official: _.kebabCase('Foo Bar') → 'foo-bar'.
Kebab uses hyphens (foo-bar). Snake uses underscores (foo_bar). Use _.snakeCase() for underscores.
Yes. Spaces, underscores, and most punctuation act as word separators and are not kept in the output.
Yes. It is a common way to turn titles into hyphenated, URL-friendly paths.
It splits on case boundaries, so 'fooBar' → 'foo-bar'.
_.lowerCase joins words with spaces ('foo bar'). _.kebabCase joins with hyphens ('foo-bar').