PascalCase Explained: Rules, Examples, and When to Use It | TitleCasePro
PascalCase capitalizes every word including the first. It is the standard for classes, interfaces, and React components in most programming languages.
PascalCase (also called UpperCamelCase) is a naming convention where every word in an identifier starts with a capital letter, with no spaces or separators between words.
Examples:
UserProfileBackgroundColorGetUserByIdHttpRequestHandlerMyReactComponent
Key rule: Unlike camelCase — which starts with a lowercase first letter (
userName) — PascalCase capitalizes even the first word (UserName). Every single word starts with a capital letter.
The name “PascalCase” comes from the Pascal programming language. “UpperCamelCase” is an alternative name that makes the distinction from camelCase explicit.
PascalCase vs. camelCase
The only difference is the first letter:
| Convention | First letter | Example | Primary use |
|---|---|---|---|
camelCase | lowercase | userProfile | Variables, functions, methods |
PascalCase | Uppercase | UserProfile | Classes, interfaces, types, React components |
Rule of thumb: In most modern languages and frameworks —
camelCasefor variables and functions;PascalCasefor types, classes, and components.
Where PascalCase Is Used
React components (required, not optional)
React uses the capitalization of the component name to distinguish between DOM elements and custom components:
<div>→ DOM element<myButton>→ treated as a DOM element, will not render correctly<MyButton>→ React component ✅
PascalCase is mandatory for React components. This is enforced by the framework, not just a convention.
Classes in OOP languages
class DatabaseConnection {} // TypeScript/JavaScript — PascalCase
public class HttpClient {} // Java — PascalCase
class UserModel: # Python — PascalCase for classes only
pass # (Python uses snake_case for methods/variables)
TypeScript interfaces and types
interface ApiResponse {
statusCode: number;
data: UserProfile;
}
type UserId = string;
enum HttpMethod { GET = 'GET', POST = 'POST' }
C# — a special case
Note: C# uses PascalCase for both public methods and public properties — unlike Java, which uses camelCase for methods. This is a common source of confusion when moving between the two languages.
public class UserService {
public string UserName { get; set; } // PascalCase property
public void GetUserById(int id) { } // PascalCase method (C# convention)
}
PascalCase vs. Other Conventions
| Convention | Example | Where |
|---|---|---|
camelCase | firstName | JS/TS variables, functions; Java methods |
PascalCase | FirstName | Classes, types, React components, C# methods |
snake_case | first_name | Python variables/functions, DB columns, Rust |
CONSTANT_CASE | FIRST_NAME | Constants, environment variables |
kebab-case | first-name | URLs, CSS class names, HTML attributes |
Rules for Writing PascalCase
- Every word starts with a capital letter —
UserProfile, notUserprofileoruserProfile. - No separators — no spaces, underscores, or hyphens between words.
- Abbreviations as words (modern style): Treat abbreviations as regular words —
HttpRequest,ApiClient,HtmlParser. Avoid fully capitalized abbreviations likeHTTPRequestorAPIClientin new code (they make compound names harder to read). - Short acronyms (2–3 letters): Common exceptions —
IO,DB,IDare sometimes kept fully uppercase, but this varies by codebase. Follow whatever convention your team uses.
⚠️ Common mistake: Writing
HTTPSConnectioninstead ofHttpsConnection. The first version is harder to parse visually. Modern style guides (Google, Airbnb) recommend treating abbreviations as single words.
Converting Text to PascalCase
The case converter converts any phrase to PascalCase instantly. Paste “get user profile” and it shows GetUserProfile (PascalCase) alongside getUserProfile (camelCase), get_user_profile (snake_case), GET_USER_PROFILE (CONSTANT_CASE), and all other formats simultaneously.
Ready to try it?
Use our free Case Converter to apply these rules instantly — no signup required.
Open Case Converter →Related articles
What Is Title Case? Rules, Examples, and Style Guides
Title case capitalizes principal words in headings. Learn the rules, see examples, and how APA, Chicago, AP, and MLA styles differ.
What Does Sentence Case Mean? Rules and Examples
Sentence case capitalizes only the first word and proper nouns. Learn when to use it, how it differs from title case, and where each is standard.
APA Title Case Rules: Complete Guide for 2026
APA 7th Edition title case lowercases all prepositions regardless of length. Complete rules, examples, and comparison with Chicago, AP, and MLA styles.
Chicago Style Title Case Rules Explained
Chicago Manual of Style title case capitalizes prepositions of 5+ letters but lowercases shorter ones. Complete CMOS 17 rules with examples.