What Is PascalCase? Examples and Rules

A clear guide to PascalCase for classes, components, and types—with mistakes to avoid.

Definition

PascalCase joins words without spaces and capitalizes the first letter of each word: `UserProfile`, `OrderLineItem`, `HttpClientFactory`. It is also called UpperCamelCase.

Where teams use it

C# class names, Java public types, React component files, TypeScript interfaces, and Swift types commonly use PascalCase. API resource names in .NET ecosystems often appear in PascalCase in docs even when JSON properties use camelCase.

PascalCase vs camelCase

camelCase starts lowercase (`userProfile`). Use camelCase for variables and functions in JavaScript; PascalCase for React components and ES6 classes. Mixing them in one file is normal—consistency within each category matters.

Common mistakes

Acronyms trip people up: prefer `HttpRequest` or `HTTPRequest` per team style, but do not switch mid-repo. Avoid PascalCase for database snake_case columns unless your ORM maps names automatically.

Frequently Asked Questions

Is PascalCase the same as UpperCamelCase?

Yes. Both terms describe the same capitalization pattern.

Should file names match class names?

In many frameworks yes (`UserCard.tsx` exports `UserCard`). Follow your framework’s generator and linter defaults.