TitleCasePro logo TitleCasePro

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.

· 4 min read · Try Case Converter →

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:

  • UserProfile
  • BackgroundColor
  • GetUserById
  • HttpRequestHandler
  • MyReactComponent

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:

ConventionFirst letterExamplePrimary use
camelCaselowercaseuserProfileVariables, functions, methods
PascalCaseUppercaseUserProfileClasses, interfaces, types, React components

Rule of thumb: In most modern languages and frameworks — camelCase for variables and functions; PascalCase for 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

ConventionExampleWhere
camelCasefirstNameJS/TS variables, functions; Java methods
PascalCaseFirstNameClasses, types, React components, C# methods
snake_casefirst_namePython variables/functions, DB columns, Rust
CONSTANT_CASEFIRST_NAMEConstants, environment variables
kebab-casefirst-nameURLs, CSS class names, HTML attributes

Rules for Writing PascalCase

  1. Every word starts with a capital letterUserProfile, not Userprofile or userProfile.
  2. No separators — no spaces, underscores, or hyphens between words.
  3. Abbreviations as words (modern style): Treat abbreviations as regular words — HttpRequest, ApiClient, HtmlParser. Avoid fully capitalized abbreviations like HTTPRequest or APIClient in new code (they make compound names harder to read).
  4. Short acronyms (2–3 letters): Common exceptions — IO, DB, ID are sometimes kept fully uppercase, but this varies by codebase. Follow whatever convention your team uses.

⚠️ Common mistake: Writing HTTPSConnection instead of HttpsConnection. 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.

Related articles