camelCase, snake_case and kebab-case: what those glued-together words mean
Programmers write multi-word names without spaces in specific styles. Learn what camelCase, snake_case, kebab-case and PascalCase mean, and where each one is used.
Sooner or later you read something from a developer and meet a word like camelCase or snake_case written as if the space bar stopped working. It is not a typo. It is a naming convention, and the strange spelling is the point.
The short answer: these are styles for joining words when spaces are not allowed. The capital letters or punctuation marks do the job the space would normally do.
Why words get glued together
Spaces are natural for people but awkward for computers. Variable names in code, file names, web addresses, and setting keys often cannot contain spaces, because a space can mean "end of this thing, start of the next one" to a program.
So multi-word names need another way to show where one word stops and the next begins. Two broad solutions exist: change the case of each word, or replace the space with a visible character. Each specific choice got a nickname, and the nicknames stuck.
A tour of the common styles
These are the names you will actually meet, with examples you can recognise at a glance:
| Style | Looks like | Where you see it |
|---|---|---|
| camelCase | myShoppingList |
JavaScript variables and functions |
| PascalCase | MyShoppingList |
Class names, components, brand names like YouTube |
| snake_case | my_shopping_list |
Python code, database columns, some settings files |
| kebab-case | my-shopping-list |
Web addresses, file names, CSS class names |
| UPPER_SNAKE_CASE | MAX_ATTEMPTS |
Constants, values that never change |
The nicknames are visual jokes. In camelCase the capital letters form humps in the middle of the word. In snake_case the underscores connect the words like a low crawling line. Kebab-case threads the words onto skewers, hyphen to hyphen.
One practical warning: kebab-case and snake_case look similar but are not interchangeable. A system expecting my_setting will not find my-setting, and vice versa. The hyphen and underscore are different characters, however alike they look on screen.
Where you will meet each one
A little context helps the styles stick:
- Web addresses use kebab-case, which is why this very article's address contains hyphens. Search engines treat hyphens as word separators, and they survive being read out loud.
- JavaScript code leans on camelCase because spaces and hyphens are both forbidden in variable names.
- Python and databases prefer snake_case for readability, since lowercase words with underscores scan easily.
- File names are safest in kebab-case, because hyphens behave well across Windows, Mac, and Linux while some systems trip over other characters.
You do not need to memorise which industry uses which. The useful skill is recognition: when you see checkout_button versus checkoutButton versus checkout-button, you are looking at the same words in three different houses.
Changing case without retyping
When you need a name in a particular style, retyping invites typos, especially with longer phrases. The Case Converter on SenangWebsite switches any text between camelCase, snake_case, kebab-case, PascalCase, and the everyday UPPER and lower styles. Paste the text, pick the style, copy the result. It runs locally in your browser, so nothing you paste goes anywhere.
For web addresses specifically, the Text to Slug tool goes a step further: it turns a title into a clean URL-friendly slug, removing characters that cause trouble in addresses.
A small note on capitals in everyday writing
These conventions are for computers. In normal writing, spaces and ordinary capitals remain the right choice, and all-caps sentences are harder to read, not more important sounding.
The real value of knowing the styles is practical: you can name a file so every system handles it gracefully, read a developer's message without guessing, and spot when a setting key is in the wrong style, which is a surprisingly common cause of "it still doesn't work" moments.