Developer
The Complete Guide to Developer Naming Conventions
By CaseSwitch Team · 2026-08-17 · 14 min read
camelCase, PascalCase, snake_case, kebab-case, and dot.case — when to use each style, with examples for JavaScript, Python, URLs, databases, and APIs.
Every codebase needs consistent names for variables, functions, classes, files, database columns, and API fields. Pick the wrong convention and you get merge conflicts, lint errors, and URLs that search engines cannot parse. This guide explains the six conventions developers use most often, when each one applies, and how to convert between them without manual editing.
Why naming conventions matter
- Readability — consistent casing tells you at a glance whether something is a variable, class, or constant.
- Tooling — linters (ESLint, Pylint) and formatters expect specific styles per language.
- Interoperability — JSON APIs, GraphQL schemas, and SQL databases often disagree on casing; you need a mapping strategy.
- SEO — URL slugs and file names use kebab-case; getting this wrong hurts discoverability.
The six conventions at a glance
- camelCase — userProfileId (JavaScript variables, JSON keys in many APIs)
- PascalCase — UserProfileCard (classes, React components, TypeScript types)
- snake_case — user_profile_id (Python, Ruby, SQL columns, environment variables)
- kebab-case — user-profile-id (URLs, CSS classes, HTML data attributes, CLI flags)
- dot.case — user.profile.id (i18n keys, config paths, DNS labels)
- SCREAMING_SNAKE_CASE — MAX_RETRY_COUNT (constants in many languages — uppercase + underscores)
camelCase
The first word is lowercase; each following word starts with a capital letter. No spaces, underscores, or hyphens. JavaScript, TypeScript, Java, and Kotlin use camelCase for variables and functions. JSON APIs often return camelCase keys because front-end clients expect it.
// JavaScript
const userProfileId = 42;
function fetchOrderHistory() { ... }Convert phrases or snake_case strings with the camelCase Converter.
PascalCase (UpperCamelCase)
Identical to camelCase except the first letter is also capitalized. Use PascalCase for class names, React components, TypeScript interfaces, and C# types. A file named UserProfile.tsx should export a component called UserProfile, not userProfile.
class UserProfileService { ... }
interface OrderSummary { ... }Generate PascalCase from plain text with the PascalCase Converter.
snake_case
All lowercase with underscores between words. Python (PEP 8), Ruby, and Rust use snake_case for functions and variables. SQL databases almost always use snake_case for table and column names because it is readable and unambiguous.
# Python
def fetch_user_profile(user_id):
return db.query(user_id)
-- SQL
SELECT user_profile_id FROM order_history;Migrate API responses or ORM models with the snake_case Converter.
kebab-case (dash-case)
Lowercase words joined by hyphens. This is the standard for URL slugs, CSS class names, and HTML custom attributes. Google treats hyphens as word separators in URLs, which helps pages rank for individual keywords.
https://example.com/blog/user-profile-settings
css: .nav-bar-item { ... }
data-test-id="submit-button"Turn titles into SEO-friendly slugs with the kebab-case Converter or
Slug Generator. For the SEO rationale, read our guide on URL slugs and kebab-case.
dot.case
Words separated by periods. Common in translation keys (i18next, Rails I18n), nested configuration, and object path accessors. DNS hostnames also use dot-separated labels, though those follow their own rules.
{
"errors.validation.email.invalid": "Please enter a valid email."
}Build dot-separated keys from phrases with the dot.case Converter.
Choosing a convention per layer
Full-stack projects often use different conventions at each layer. A typical React + Node + PostgreSQL stack might look like this:
- Database columns: snake_case (user_profile_id)
- API JSON response: camelCase (userProfileId) — transformed by the ORM or serializer
- React components: PascalCase (UserProfileCard)
- CSS modules: camelCase or kebab-case depending on team preference
- URL routes: kebab-case (/user-profile/settings)
- Environment variables: SCREAMING_SNAKE_CASE (DATABASE_URL)
Migrating between conventions
The most common migration paths are database snake_case to API camelCase, spreadsheet headers to code variables, and blog titles to URL slugs. Manual find-and-replace fails when you have hundreds of fields or nested objects. Automated converters handle word boundaries, acronyms, and existing separators consistently.
Quick reference: input → output
- user profile settings → userProfileSettings (camelCase)
- user profile settings → UserProfileSettings (PascalCase)
- user profile settings → user_profile_settings (snake_case)
- user profile settings → user-profile-settings (kebab-case)
- user profile settings → user.profile.settings (dot.case)
Common mistakes
- Mixing conventions in the same layer — e.g. userId and user_profile_id in the same API response.
- Using kebab-case in JavaScript variable names — hyphens are interpreted as minus operators.
- Title Case or spaces in database column names — requires quoting in SQL and breaks ORMs.
- Ignoring acronym casing — treat API and URL as words (apiKey, not APIKey) unless your style guide says otherwise.
- Forgetting locale — some languages do not have clear word boundaries; converters work best on Latin-script input.
Further reading
New to camelCase? Start with What Is camelCase?.
For URL SEO, see SEO URL Slugs: Why kebab-case Wins.
Google's documentation on URL structure explains how readable URLs help users and search engines.
Bookmark the CaseSwitch homepage converter for quick case changes, or open the dedicated tool page when you need a specific style with examples and conversion history.