← Back to Blog
Developer

camelCase vs snake_case vs PascalCase — When to Use Each

April 4, 2026 · 5 min read

Every programming language has a preferred way to name things. Here's when to use camelCase, snake_case, PascalCase, and kebab-case.

camelCase

First word lowercase, every next word capitalized. No spaces or separators.

myVariableName, getUserData, isLoggedIn

Used in: JavaScript, Java, TypeScript, C#, Swift

Used for: variables, function names, method names

PascalCase

Every word capitalized, including the first. Also called UpperCamelCase.

MyClassName, UserProfile, HttpRequest

Used in: JavaScript (classes), C# (classes, methods), Java (classes), TypeScript

Used for: class names, component names, type names

snake_case

All lowercase with underscores between words.

my_variable, user_name, get_user_data

Used in: Python, Ruby, Rust, SQL, PHP

Used for: variables, functions, file names, database columns

CONSTANT_CASE

All uppercase with underscores. Also called SCREAMING_SNAKE_CASE.

MAX_SIZE, API_KEY, DATABASE_URL

Used in: all languages

Used for: constants, environment variables, config values

kebab-case

All lowercase with hyphens between words.

my-component, user-profile, main-content

Used in: HTML, CSS, URLs, file names

Used for: CSS classes, URL slugs, HTML attributes

Quick rule: match what your language and team already use. Consistency matters more than which convention you pick.

Quick Reference

Need to convert between these formats quickly? Use our free case converter tool. Paste your text, click the format you need, and copy.

Try the Case Converter →