na.to.
📚 All keywords › 🧰 Free Web Tools › Case Conversion: When to Use camelCase, snake_case, kebab-case
KO EN
🔠

Case Conversion: When to Use camelCase, snake_case, kebab-case

Upper- and lowercase, Title Case vs Sentence case, and where camelCase, PascalCase, snake_case and kebab-case are used in programming, with examples.

📚 Free Web Tools · 27/52· ⏱ About 4min read ·Information updated 2026-11-03
📋 Key facts5
camelCase
First word lowercase, later words capitalised
PascalCase
Every word capitalised
snake_case
Lowercase with underscores
kebab-case
Lowercase with hyphens; common in URLs and CSS
Title Case
For headings; rules for short words vary by style guide

Why the same words take different shapes

English has upper- and lowercase letters, so the same word can be written in several shapes. In documents, case distinguishes headings and the start of sentences; in programming, it marks word boundaries in names that cannot contain spaces, such as variables, files and addresses. This site's case converter changes text to uppercase, lowercase, Title Case or Sentence case, as well as camelCase, PascalCase, snake_case and kebab-case, with one button.

UPPERCASE and lowercase

All capitals (UPPERCASE) are used for warnings, abbreviations and constant names, while all lowercase is handy for tidying email addresses and web addresses. The domain part of an email address is not case-sensitive, but the part before the @ may be under the standard, so it is safer not to lowercase other people's addresses carelessly. Long passages in capitals are hard to read and feel like shouting, so keep them for short emphasis.

Title Case and Sentence case

Title Case capitalises the first letter of each word in a heading, while Sentence case capitalises only the first letter and proper nouns, as in a sentence. English style guides keep short words such as a, of and the lowercase in Title Case, but the details differ between guides. This site's converter simply capitalises the first letter of every word and lowercases the rest, so abbreviations such as NASA and names such as iPhone need fixing by hand afterwards.

Four programming conventions

Variable and file names cannot contain spaces, so word boundaries are marked with capitals or symbols. Which style to use is set by the conventions of the language and project, and the most important thing is to stick to one within a project.

  • camelCase: userName — variables and functions in JavaScript and Java
  • PascalCase: UserName — class and type names in many languages
  • snake_case: user_name — Python variables and functions, database column names
  • kebab-case: user-name — web addresses, CSS classes, file names

Constants and other styles

UPPER_SNAKE_CASE, all capitals with underscores (for example MAX_SIZE), is commonly used in many languages for values that never change, that is, constants. Environment variable names usually take this shape too. A program treats the same name in different styles as different names, so conversion is often needed at boundaries, such as when moving snake_case database columns into camelCase JavaScript properties.

Why web addresses use hyphens

kebab-case is common in web addresses and file names. Some servers treat addresses as case-sensitive, so sticking to lowercase is safer, and underscores can be hard to see when a link is underlined. Google's search documentation also recommends separating words in URLs with hyphens (as of November 2026). Changing an address that is already in use breaks existing links, though, so a redirect from the old address to the new one is needed.

Points to watch when converting

Automatic conversion guesses word boundaries from spaces, hyphens, underscores and changes in case. Names with abbreviations, such as XMLHttpRequest, may therefore not split the way you expect. Hangul has no case, so it stays the same after conversion. Some languages have their own case rules, such as the dotted i in Turkish, so check the result if you convert text that is not in English.

Summary

There is no single right style; follow the conventions of the place you are writing for.

  • JavaScript variables in camelCase, classes in PascalCase
  • Python and database columns in snake_case
  • Web addresses and CSS in kebab-case
  • Constants and environment variables in UPPER_SNAKE_CASE
  • After Title Case conversion, check abbreviations and names by hand

🔗 More in this category

🧰 Related tools

🌍 Search the web for this

Each button runs this keyword on that search engine