The Complete Guide to Text Case Formats: camelCase, snake_case, and More
Case conventions carry meaning, signal identifier type, and affect interoperability between systems. Every format explained, with examples, rules, and a quick-reference table for every context.
Text case conventions seem like a minor detail until you are integrating a Python backend with a JavaScript frontend, adapting SQL column names to TypeScript interfaces, or working on a team where inconsistent naming has made the codebase hard to read. Case conventions are not arbitrary style preferences. They carry meaning, signal the type of identifier you are looking at, and affect interoperability between systems.
Why Case Conventions Matter
Most experienced developers can scan a line of code and immediately know what kind of identifier they are looking at, before reading the context, because naming conventions encode that information directly. This is not accidental:
Case is not cosmetic. A developer who violates naming conventions in a new codebase is not just inconsistent. They are adding cognitive overhead to every future reader of that code.
Every Case Format Explained
Nine formats cover the full range of what you will encounter in professional development. Each has a specific niche:
The Interoperability Problem — and Why It Matters
The most common real-world case convention problem is not within a single language. It is at the boundary between systems. A Python backend follows snake_case. A JavaScript frontend follows camelCase. A PostgreSQL database follows snake_case for columns. A REST API response might use either.
Here is what the same "user ID" field looks like across a typical full-stack application:
When the API returns user_id (Python convention) and the frontend accesses response.userId (JavaScript convention), the result is undefined, silently, with no error. This is one of the most common integration bugs in full-stack development, caused entirely by case convention mismatch.
When adapting field names between systems with different conventions, the Case Converter handles any transformation instantly. Convert user_first_name to userFirstName, UserProfile to user-profile, or any other combination. Paste the field names once, convert to any format.
Quick Reference — Context to Convention
Bookmark this table. It maps every common development context to the correct convention:
| Context | Convention | Example |
|---|---|---|
| JavaScript variable | camelCase | userName |
| JavaScript function | camelCase | getUserById() |
| JavaScript class | PascalCase | UserProfile |
| JavaScript constant | SCREAMING_SNAKE_CASE | MAX_RETRIES |
| React component | PascalCase | LoginButton |
| TypeScript interface | PascalCase | UserPreferences |
| TypeScript type alias | PascalCase | ApiResponse |
| Python variable | snake_case | user_name |
| Python function | snake_case | get_user_by_id() |
| Python class | PascalCase | UserProfile |
| Python constant | SCREAMING_SNAKE_CASE | MAX_CONNECTIONS |
| SQL column | snake_case | created_at |
| CSS class name | kebab-case | nav-menu-item |
| HTML data attribute | kebab-case | data-user-id |
| URL slug | kebab-case | /json-formatter |
| Environment variable | SCREAMING_SNAKE_CASE | DATABASE_URL |
| CLI flag | kebab-case | --output-format |
| Page title | Title Case | How to Format JSON |
| Meta description | Sentence case | Learn how to format json online |
Frequently Asked Questions
In camelCase, the first word is lowercase and each subsequent word starts with a capital: myVariableName. In PascalCase, every word is capitalised including the first: MyVariableName. PascalCase is used for classes, types, and React components. camelCase is used for variables, functions, and object properties.
PEP 8, the official Python style guide, specifies snake_case for variable and function names. The reason is readability: get_user_by_id is considered more readable than getUserById in Python's design philosophy. Python classes use PascalCase, consistent with most OOP languages.
CSS class names cannot contain underscores as meaningful separators (they are valid but confusing), and camelCase and PascalCase require you to remember capitalisation. kebab-case was established early in CSS tooling and is now the universal standard. It also aligns with HTML attributes (which are lowercase) and URL slugs (which use hyphens as word separators per Google's URL guidance).
It depends on context and house style. Title Case is traditional for article headlines, book titles, and formal headings. Sentence case has become more common in modern product writing, SaaS UIs, and blog posts because it reads more naturally and conversationally. Many style guides (Google, Apple, Microsoft) now recommend Sentence case for UI copy and documentation.
If a Python API returns user_id and a JavaScript frontend accesses response.userId, the result is undefined, silently, with no error. This is one of the most common integration bugs in full-stack development. The solution is to normalise at the API boundary: either use a serialiser that outputs camelCase from the Python backend, or write a client-side mapping layer that converts field names on receipt.
Convert text to any case format instantly
Paste your text once and convert it to camelCase, PascalCase, snake_case, kebab-case, SCREAMING_SNAKE_CASE, Title Case, or Sentence case. No login, no setup.
Conventions Are Communication
Case conventions are not a matter of taste. They are a shared language. When every developer on a team follows the same conventions, code becomes self-documenting. The case of an identifier tells you its type, its language, and its layer of the stack before you read a single character of its name.
The interoperability angle matters just as much. A case mismatch at a system boundary, user_id from the API with userId expected by the frontend, is one of the most common silent bugs in full-stack development. Understanding which convention each layer uses, and converting deliberately when you cross a boundary, eliminates an entire class of integration failures.
Use the quick reference table above whenever you are writing in an unfamiliar context. Use the Case Converter when you need to adapt field names between systems. And when in doubt: camelCase for JavaScript, snake_case for Python, PascalCase for classes, SCREAMING_SNAKE_CASE for constants, kebab-case for CSS and URLs.