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.
Quick answer: PascalCase capitalizes the first letter of every word, including the first — like
UserProfileorHttpRequest. It is the standard for classes, interfaces, types, and React components.
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.
Developer Naming Conventions
Ready to try it?
Use our free Case Converter to apply these rules instantly — no signup required.
Open Case Converter →Related articles
How Long Does It Take to Read and Speak Text? (WPM Reference)
Reading time and speaking time are calculated from word count. Here are the exact formulas, average WPM rates by context, and a comparison table for common content lengths.
How to Clean Up Messy Text — Remove Line Breaks, Spaces, and Duplicates
A practical guide to fixing common text formatting problems: extra line breaks from PDFs, double spaces, blank lines, and duplicate entries. Includes one-click fixes.
How to Extract Email Addresses From Text (Any Format)
Learn how to extract email addresses from plain text, HTML, CSV files, and logs instantly — and which patterns count as valid emails.
How to Extract URLs From Text — Links, Hrefs, and Bare Domains
How to pull all URLs and links out of any text — HTML source, Markdown, log files, or plain prose — and get a clean deduplicated list.