Last updated: March 2026
Programming Naming Conventions
Every programming language and framework has conventions for naming variables, functions, classes, and constants. Using the right case isn't just about style — it's about communicating intent through naming. A developer who sees MAX_RETRIES instantly knows it's a constant. getUserData is clearly a function. UserProfile is a class.
JavaScript and TypeScript use camelCase for variables and functions (firstName, fetchUsers), PascalCase for classes and React components (UserService, NavBar), and CONSTANT_CASE for constants (API_BASE_URL).
Python uses snake_case for almost everything — variables, functions, modules, packages (user_name, get_user_data). Classes use PascalCase (UserProfile). Constants use CONSTANT_CASE.
CSS uses kebab-case exclusively: .nav-item, .btn-primary, background-color. This is because CSS is case-insensitive and hyphens are valid in identifiers. BEM naming follows this: .block__element--modifier.
When working across languages — say, a JavaScript frontend consuming a Python API — you'll often need to convert between cases. An API might return user_name (Python convention), but your React component needs userName (JavaScript convention). This converter makes that transformation instant.
Frequently Asked Questions
What is camelCase?
camelCase starts with a lowercase letter and capitalizes the first letter of each subsequent word, with no spaces or separators: myVariableName, getUserData, isActive. It's the standard for JavaScript/TypeScript variables and functions.
What's the difference between camelCase and PascalCase?
camelCase: myVariable (first letter lowercase). PascalCase: MyVariable (first letter uppercase). PascalCase is used for class names in most languages, React component names, and C# methods.
When should I use snake_case?
snake_case is standard in Python, Ruby, and Rust for variable and function names. It's also common in database column names and API parameters. Words are separated by underscores and all lowercase.
What is kebab-case used for?
kebab-case (words separated by hyphens) is used for CSS class names, URL slugs, HTML attributes, and file names. It's the standard in CSS: .my-component, .nav-item.
What about CONSTANT_CASE?
CONSTANT_CASE (all uppercase with underscores) is used for constants and environment variables across most languages: MAX_RETRIES, API_KEY, DATABASE_URL. It signals that a value shouldn't change.
Can I convert between any cases?
Yes. Enter text in any format — natural language, camelCase, snake_case, etc. — and click any button to convert. The converter strips non-alphanumeric characters and reformats according to the selected case.