PascalCase vs camelCase

Both glue words without spaces, but the first letter tells you which layer of the stack you are naming.

The one-letter rule

camelCase starts lowercase: userProfileId. PascalCase starts uppercase: UserProfileId. That single difference maps to variables versus types in most modern codebases.

JavaScript and TypeScript

Variables, functions, and object properties → camelCase. Classes, React components, and type aliases → PascalCase. Linters enforce this split so imports read predictably.

JSON and APIs

Many REST APIs document camelCase field names even when databases use snake_case. Document the mapping at the boundary so mobile and web clients do not guess.

Common mistakes

Naming React components in camelCase. Exporting PascalCase JSON keys to JavaScript clients without transformation. Using PascalCase for environment variables — use CONSTANT_CASE instead.

Complete guide to text case and naming styles

Frequently asked questions

Should file names match PascalCase components?

Most React teams name files after the component (UserCard.tsx). Consistency helps search and imports.

Which do Python developers use?

Python prefers snake_case for variables and functions. PascalCase appears on class names, similar to TypeScript.

Which one starts with a lowercase letter?

camelCase does. PascalCase starts with a capital. A class or a React component is usually PascalCase. A variable or a function in JavaScript is usually camelCase.