Text Case Conventions in Programming: camelCase, snake_case, kebab-case & More
A complete guide to software naming conventions. Master camelCase, PascalCase, snake_case, kebab-case, and CONSTANT_CASE across modern programming languages.
Try the Case Converter
Calculate your numbers instantly in your browser. Fast, free, no signup.
Because spaces are illegal in identifiers across virtually all programming languages, software engineers devised structured conventions to join words while maintaining readability.
Choosing the proper case is not merely an aesthetic preference; in modern software engineering, naming conventions communicate architectural intent, variable scope, class definitions, and type hierarchies.
1. camelCase (lowerCamelCase)
In camelCase, words are concatenated together with no spaces or punctuation. The very first word begins with a lowercase letter, and every subsequent word starts with a capital letter:
userProfileImagecalculateTotalDiscountisAuthenticationActive
Industry Standards:
- JavaScript / TypeScript: Variables, function declarations, class methods, object properties.
- Java: Local variables and method signatures.
- Go: Unexported (package-private) variables and functions.
2. PascalCase (UpperCamelCase)
PascalCase (named after the Pascal programming language) follows camelCase with one key exception: the very first letter is also capitalized:
UserProfilePaymentProcessorHttpRequestHandler
Industry Standards:
- React / Vue / Svelte: Component names (
<UserAvatar />). - TypeScript / C# / Java: Class names, interfaces, enums, and type definitions.
- Python: Class declarations (PEP 8 convention).
3. snake_case (Pothole Case)
In snake_case, words are written in all-lowercase and joined by an underscore (_):
user_profile_idparse_configuration_filetotal_active_sessions
Industry Standards:
- Python: Standard variables, module names, and function names (PEP 8).
- Rust: Function and variable identifiers.
- SQL / Relational Databases: Table and column names (
created_at,order_status). - Ruby: Method and variable names.
4. kebab-case (lisp-case / spinal-case)
In kebab-case, words are written in lowercase and joined by a hyphen or dash (-):
user-profile-cardmain-nav-containerbtn-primary-lg
Industry Standards:
- HTML & CSS: Class names, IDs, data attributes (
data-tool-id). - URLs & Slugs: Clean SEO-friendly URL paths (
/blog/mastering-unit-conversions). - Package Managers: npm package names and GitHub repository names.
5. CONSTANT_CASE (SCREAMING_SNAKE_CASE)
In CONSTANT_CASE, all letters are capitalized and separated by underscores:
API_BASE_URLMAX_RETRY_ATTEMPTSDEFAULT_TIMEOUT_MS
Industry Standards:
- Global Constants: Immutable global configuration variables in JS, Python, Java, and C++.
- Environment Variables:
.envkeys (DATABASE_URL,JWT_SECRET).
Quick Reference Summary
| Convention | Pattern Example | Primary Language Ecosystems |
|---|---|---|
| camelCase | getUserData | JavaScript, TypeScript, Java, Dart |
| PascalCase | UserData | React, C#, TypeScript Interfaces, OOP Classes |
| snake_case | get_user_data | Python, Rust, Ruby, SQL Tables |
| kebab-case | get-user-data | CSS Classes, URL Slugs, CLI Flags |
| CONSTANT_CASE | MAX_USERS | Environment Variables, Global Constants |
Convert Casing in 1-Click
Converting variable names or lists between snake_case, camelCase, kebab-case, and Title Case by hand is tedious. Paste your text into our free Case Converter to transform your text instantly.
ToolsHub Editorial Team
Verified AuthorTechnical Architect & Lead Developer • ToolsHub Pro
Abdul Nabi is a senior software engineer and technical architect specializing in client-side Web APIs, high-performance browser computing, cryptographic validation, and privacy-first digital utility platforms. All guides on ToolsHub Pro are peer-reviewed for mathematical rigor and developer accuracy.