Dollar TechTECHNOLOGIES
WritingDevelopment·August 25, 2026·2 min read

camelCase, snake_case and kebab-case Explained

camelCase vs snake_case vs kebab-case: what each naming style means, where to use it, and simple examples for variables, files, URLs and more.


When you name things in code, files or URLs, you cannot use spaces, so you need a way to join words together. Over the years a handful of naming styles became standard, and each has its own place. The three you will meet most often are camelCase, snake_case and kebab-case.

The three styles at a glance

| Style | Example | Words joined by | |---|---|---| | camelCase | myVariableName | Capital letters, no separator | | snake_case | my_variable_name | Underscores | | kebab-case | my-variable-name | Hyphens |

There are two close relatives worth knowing. PascalCase is like camelCase but with the first letter capitalised too, as in MyVariableName. SCREAMING_SNAKE_CASE is snake_case in all capitals, as in MY_CONSTANT.

When to use each

The right choice usually depends on the convention of the language or system you are working in.

  • camelCase is common for variables and functions in JavaScript, Java and many other languages.
  • snake_case is common for variables in Python and Ruby, and for column names in databases.
  • kebab-case is used where hyphens are safe and readable, most notably in URL slugs and CSS class names. It is not valid for variable names in most languages, because the hyphen reads as a minus sign.
  • PascalCase is typically used for class and component names.
  • SCREAMING_SNAKE_CASE is reserved for constants that never change.

A simple rule of thumb

Follow the convention already in use. If you are editing a Python project, match its snake_case. If you are writing a URL, use kebab-case. Consistency inside a project matters more than which style you personally prefer, because mixed styles make code and content harder to read and search.

Convert between them instantly

Retyping text into a different case is tedious and easy to get wrong. Our free Case Converter turns any text into UPPERCASE, lowercase, Title Case, Sentence case, camelCase, snake_case and kebab-case at once, so you can copy the exact format you need in a click.

The takeaway

camelCase joins words with capital letters, snake_case uses underscores, and kebab-case uses hyphens. Pick the one your language, file system or URL expects, stay consistent within a project, and you will avoid a whole category of small but annoying bugs.

Keep reading