What Is PascalCase? Definition and Examples
·4 min read
Defining PascalCase
PascalCase (also called UpperCamelCase) is a naming convention where every word starts with an uppercase letter, with no spaces or separators. Unlike camelCase, the very first letter is also capitalized.
Examples: MyClassName, UserProfile, HttpRequest, ConvertCase
PascalCase vs camelCase
The only difference is the first letter:
- PascalCase:
MyVariableName - camelCase:
myVariableName
Both avoid spaces and use capital letters to mark word boundaries.
When Is PascalCase Used?
PascalCase is standard for:
- Class names in virtually every object-oriented language (Python, Java, C#, TypeScript, Kotlin)
- React components — component names must be capitalized to distinguish them from HTML elements
- Type and Interface names in TypeScript
- Enum names and values in C# and some other languages
- Constructors in JavaScript
PascalCase in React
In React, every component must be in PascalCase. Writing <myButton /> would be treated as an HTML element, while <MyButton /> is treated as a React component.
Convert to PascalCase Instantly
Need to convert text or a variable name to PascalCase? Use our PascalCase converter to transform any text instantly.