Kebab Case Converter

Converted text—
Words—
Characters—

How Kebab Case Converter is calculated: kebab-case = split on spaces, hyphens, underscores and camel humps; every word lowercased, joined with single hyphens.

What is a kebab case converter?

A kebab case converter turns ordinary words into kebab-case — the style where words are lowercase and joined with hyphens. hello world example becomes hello-world-example, 20 characters. It is the naming style of URLs, CSS classes, and HTML attributes, and this tool makes it from any text you type, instantly, as you type.

The need comes up every time a developer names something a browser will see. A CSS class that styles a user name becomes user-name. A page about an order total lives at /order-total. A file that holds the site header is called site-header.html. Writing these names by hand is slow and error-prone — one missed hyphen and the style breaks — so a converter does the joining and the lowercasing in one step.

This converter covers the inputs people actually paste: words separated by spaces, hyphens, or underscores, and names already written in camelCase, PascalCase, or snake_case. It shows the converted name, the word count, and the character count above the output. Everything runs in your browser — your text never leaves your device, nothing is stored, and there is no account to create. A case converter changes the capitalisation of whole sentences, while this tool builds one joined name.

How a kebab case converter works

The conversion follows three plain steps. First, the text is split into words — on spaces, hyphens, and underscores, and also at the humps of any camelCase already in the input, so userAccountName splits into user, Account, and Name before anything else happens. That is what makes the tool safe to run twice: converting hello-world a second time gives hello-world again, not hello--world.

Second, every word is lowercased, so HELLO, Hello, and hello all become hello. Third, the words are joined with a single hyphen between each pair. hello world becomes hello-world, 11 characters. userAccountName becomes user-account-name, 17 characters. hello_world becomes hello-world, 11 characters.

The result is always the same for the same input, which is the whole point: a name you can trust in code and in addresses. The default text on this page, hello world example — 3 words, 19 characters — becomes hello-world-example, 20 characters, because the two spaces become two hyphens. No step needs a server or a network call, so it works offline once the page has loaded.

Camel humps, separators, and edge cases explained

Separators are the easy part. Spaces, hyphens, and underscores all mean the same thing to this converter: a word boundary. hello world, hello-world, and hello_world all become hello-world. Mixed input works too — Hello-World has a hyphen and a capital, and it still becomes hello-world, because every separator is treated the same way.

Camel humps are the clever part. A name like userAccountName has no separators at all, but the capital letters mark the word boundaries, so the converter splits before each capital that follows a small letter or a digit. That is how it reads JavaScript variable names and turns them into CSS classes, and it is also how it handles PascalCase input like UserAccountName — the first capital starts a word, and the humps do the rest.

The third edge is empty input. Text with no words in it — an empty box, or only spaces — has no name to build, so this page shows a dash in the result instead of a blank. Type a word and the converted name appears. A word counter can check the length of the same text if you are trimming a name to fit a limit.

A worked example: naming three CSS classes

Here is a real comparison, using the exact outputs this page shows. First, the default text: hello world example — 3 words, 19 characters. Split it into hello, world, and example, lowercase them all, join with hyphens, and you get hello-world-example, 20 characters. That is a CSS class name ready to paste into a stylesheet.

Second, a JavaScript variable: userAccountName — 1 word as typed, 15 characters. The humps split it into user, Account, and Name, the words are lowercased, and the same steps give user-account-name, 17 characters. This is the most common real-world use: turning a camelCase name from the code into a kebab-case class for the page it styles.

Third, a Python name: hello_world — 1 word as typed, 11 characters. The underscore splits, the words are already lowercase, and the result is hello-world, 11 characters — the same length as the input, with the separator changed. Three very different inputs, three clean kebab-case names, and not one of them needed a hand edit.

Who uses a kebab case converter, and why

Front-end developers are the biggest users. CSS classes, HTML attributes, and custom elements are written in kebab-case by convention — user-name, order-total, site-header — because hyphens are legal in CSS and in tag names where underscores and spaces are not. A converter turns a label or a variable name into a valid class in one paste.

Content and SEO writers are the second group. Page addresses are kebab-case — /hello-world-example reads better than /hello_world_example and better than /HelloWorldExample — and a slug built from the title is the address readers and search engines see. A URL encoder decoder handles the opposite problem of carrying a value safely inside a link, while this tool makes the readable tail of the address itself.

File organisers are the third group. File names with hyphens — my-report-2026.pdf, team-photo-march.jpg — are easier to read and safer to share than names with spaces, which break in links and in scripts. The tool on this page handles all three uses — paste, copy the name, use it — which covers ninety percent of what anyone needs.

Design-system teams are a fourth group, and they use the converter to keep names consistent. A component called UserCard in code becomes user-card in CSS and in the docs, and every developer on the team writes it the same way. One style across code, styles, and docs beats three styles that almost match.

Kebab case converter vs case converter

A kebab case converter and a case converter both change capitalisation, but they build different things. A case converter changes how a sentence looks — the quick brown fox becomes The Quick Brown Fox — and the words stay separate. A kebab case converter joins the words into one name — hello world becomes hello-world — and the spaces become hyphens. One styles text for reading; the other builds names for browsers.

The difference matters for workflow. Use a case converter when the text will be read by a human — a heading, a sentence, a title. Use a kebab case converter when the text will be read by a browser — a CSS class, a URL, a file name. Running a sentence through a kebab case converter gives you a valid class name; running a class name through a case converter gives you a sentence, not a name.

Never mix the two jobs up. A heading in kebab-case looks broken to a reader, and a CSS class with a space in it is not one class at all — it is two, and your styles will apply to the wrong thing. And a text formatter answers the question both tools leave open: how to tidy the text itself before any of the joining begins.

Common kebab case mistakes

The most common mistake is double hyphens. Pasting hello--world — with two hyphens — or hello - world — with a space on each side of a hyphen — can give hello--world in a careless converter, and a double hyphen in a URL looks broken even when it works. This converter collapses every run of separators into one hyphen, so the output is always clean, but check the output if you ever use a different tool.

Second: leading and trailing hyphens. An input like -hello world- can produce -hello-world- in a careless converter, and a leading hyphen in a CSS class is legal but ugly, while a trailing hyphen in a URL looks like a typo. This converter drops empty pieces at the edges, so the output never starts or ends with a hyphen.

Third: converting a whole sentence. A ten-word sentence makes a ten-word class name or URL, and a name that long is hard to read and hard to type. Class names and slugs should be two or three words: user-name, order-total, hello-world. If your input has more words than that, shorten the idea before you convert it.

Fourth: forgetting that URLs are case-sensitive on most servers. Hello-World and hello-world can be two different pages, and mixing them is a broken link waiting to happen. Convert every slug and class through the same tool, in the same lowercase style, and the addresses stay consistent.

How to use this kebab case converter

Using this kebab case converter is simple. Paste your text into the box, or type it directly. The converted name appears instantly in the box below — there is no button to press and no form to submit. The default text shows the pattern: hello world example becomes hello-world-example, 20 characters.

To copy the result, use the Copy button next to the output box. To try another name, select all, delete, and paste the new one — the output updates live. If the result comes out as a dash, your text had no words in it; type a word and the name will appear. If it comes out too long, shorten the idea to two or three words and try again.

Everything runs in your browser. No sign-up, no account, no data sent anywhere — your text never leaves your device. It works offline once the page has loaded, so you can use it on a plane, in a classroom with no signal, or anywhere else you write code. Try it with something real before you need it: paste a page title for a URL, or a label for a CSS class, and copy the name. Once you have used it twice, you will never build a kebab-case name by hand again.

Frequently Asked Questions

kebab-case is a naming style where words are all lowercase and joined with hyphens: hello-world-example. It is the standard for CSS classes, HTML attributes, custom elements, and URL slugs. The hyphens look like the skewers in a kebab, which is where the name comes from.

Split at the capital letters, lowercase everything, and join with hyphens. userAccountName becomes user-account-name — 17 characters. The converter does this automatically: it splits before each capital that follows a small letter or a digit, so it reads JavaScript names and rebuilds them as CSS classes.

Because hyphens are legal in URLs, easy to read, and treated as word separators by search engines, while underscores are not always treated that way. A slug like hello-world-example is readable to a human and to a search engine. Spaces are not allowed in URLs at all, so a separator has to be chosen, and the hyphen won.

Yes. Everything runs in your browser — your text is never uploaded, stored, or sent anywhere. You can use it offline once the page has loaded, and you can paste code names, page titles, or internal labels without worrying about who sees them.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.