Back to all guides
Text & Productivity7 min read

Naming Conventions in Programming: When to Use camelCase, kebab-case, snake_case, and PascalCase

Learn the architectural reasons and standard language idioms behind camelCase, PascalCase, snake_case, SCREAMING_SNAKE_CASE, and kebab-case.

A
Aakash Sharma
Creator of Softnag & Full-Stack Developer
Published: August 4, 2026Updated: August 16, 2026
Naming Conventions in Programming: When to Use camelCase, kebab-case, snake_case, and PascalCase - Text & Productivity Illustrated Guide
Text & Productivity

Text & Productivity technical reference asset

Share this guide

Because programming language compilers and interpreters use spaces to separate tokens, identifiers (variables, functions, classes, file names, database columns) cannot contain literal whitespace.

Over decades of software development, communities standardized distinct case conventions to visually indicate an identifier’s scope, mutability, and type. Let’s break down the rules across modern languages.

Why Consistent Case Conventions Prevent Bugs#

Adhering to community style conventions is not merely aesthetic. In languages like JavaScript and Python, case conventions immediately communicate whether an identifier is an instantiable constructor class, an exported constant, an internal variable, or an environment variable.

The Five Major Case Archetypes Explained#

Here are the structural definitions of the standard formats:

  • camelCase: First word lowercase, subsequent words capitalized with no delimiters (`userProfileData`, `calculateTotalCost`). Standard for JavaScript variables, methods, and JSON properties.
  • PascalCase (UpperCamelCase): Every word capitalized with no delimiters (`UserProfile`, `PaymentGateway`). Standard for React components, TypeScript classes, and interfaces.
  • snake_case: All lowercase with words separated by underscores (`user_profile_data`, `total_price`). Standard for Python, Ruby, and SQL column names.
  • SCREAMING_SNAKE_CASE: All uppercase with underscores (`MAX_BUFFER_SIZE`, `API_KEY`). Standard for immutable constants and environment variables.
  • kebab-case (dash-case): All lowercase with words separated by hyphens (`user-profile-data`, `btn-primary`). Standard for URL slugs, CSS class names, and package names.

Language Idiom Reference Matrix#

The matrix below provides the standard convention by ecosystem:

Ecosystem / DomainClasses & TypesVariables & FunctionsConstantsFiles & URLs
JavaScript / TypeScriptPascalCasecamelCaseSCREAMING_SNAKE_CASEkebab-case or camelCase
PythonPascalCasesnake_caseSCREAMING_SNAKE_CASEsnake_case.py
RustPascalCasesnake_caseSCREAMING_SNAKE_CASEsnake_case.rs
HTML & CSSN/Akebab-case (BEM)N/Akebab-case.html
PostgreSQL / MySQLPascalCase or snake_casesnake_caseUPPERCASEN/A
REST APIs (JSON)PascalCase (types)camelCase (preferred)N/A/kebab-case-endpoints
Official language style conventions across major programming ecosystems.

Common Naming Anti-Patterns to Avoid#

Avoid mixing conventions within the same codebase (e.g., having both `user_name` and `userName` in the same API payload). When integrating with third-party Python backends in TypeScript frontends, establish a serialization layer (such as Zod or camelcase-keys) at the API boundary to keep client code idiomatic.

Transforming Cases with Zero Manual Effort#

Converting database dumps or CSS stylesheets into TypeScript models manually is tedious and error-prone. Softnag’s Case Converter allows you to paste multi-line text and instantly toggle between camelCase, PascalCase, snake_case, UPPERCASE, and kebab-case.

Key Takeaways & Best Practices
  • camelCase is the universal standard for JavaScript and TypeScript variables.
  • PascalCase identifies classes, interfaces, and React/Vue UI components.
  • snake_case is idiomatic for Python, Ruby, and relational database columns.
  • kebab-case is standard for CSS selectors, HTML attributes, and SEO URL slugs.

Final Thoughts

Maintain clean, idiomatic code across any technology stack. Convert text between all major programming case formats in one click with Softnag’s Case Converter.

Related Technical Guides

View all 40 guides →