How to Convert to PascalCase (and What It Means for Class Names)
PascalCase, also called UpperCamelCase, capitalises every word including the first one. Classes, components, types and enums use it, which is what sets it apart from the lower camel case used for variables.
Open the tool:PascalCase Converter
When PascalCase is the right form
Setting up a batch of React components means naming the component, the file and the props type together: user profile card becomes UserProfileCard, with UserProfileCardProps alongside it. Typed by hand, the card, list and detail components drift into inconsistent capitalisation, which rarely throws but makes every reader double-check which spelling is current.
Java and C# class names, TypeScript interfaces and types, ORM entities and generated model classes all take PascalCase too. Converting a table name or a business phrase in bulk and then adding the suffix consistently beats naming each one from scratch.
- React component names and their files
- Classes, interfaces, types and enums
- Entity class names generated from table names
- Naming a group of config objects or types
The rule, and three easily missed details
The rule matches camelCase: lowercase everything, capitalise each character that follows a run of non-alphanumeric characters, then uppercase the first letter. Only that last step differs, so user profile, user_profile and user-profile all produce UserProfile with no trace of the separators.
First, existing PascalCase gets flattened: UserProfile lowercases to a single token with no separators, giving Userprofile. Second, acronyms are lowercased, so URL, ID and API become Url, Id and Api and need fixing by convention. Third, a leading digit is unaffected, so 3d model yields 3dModel rather than 3DModel.
- Feed in plain English phrases, not existing PascalCase
- Restore acronyms such as URL, ID and HTTP afterwards
- Check names that start with digits: 3d is not 3D
- Chinese characters are dropped, so translate first
- Compare against your framework's component convention
Language differences and where the tool stops
C# uses PascalCase for public classes, methods and properties. Java uses it for class names but lower camel case for methods. Go uses the leading capital to mark exported identifiers. Python uses PascalCase for classes and snake_case for functions. Reusing one name across languages means rewriting it, and that convention comes from the language, not the tool.
Acronym handling has no global answer. The .NET guidelines suggest all caps for two-letter acronyms such as IO and initial-cap only for longer ones such as Http and Xml, and Google's Java style is close to that. The tool only rearranges characters: it does not check collisions, judge meaning, lemmatise, or tell you whether User or Users fits better.
- Java, C# and TypeScript types: PascalCase
- Python classes: PascalCase; functions: snake_case
- Acronyms: two letters all caps, longer ones initial-cap
- No duplicate checking — search before you commit
FAQ
What is the difference between PascalCase and camelCase?
Only the first letter: camelCase writes userName, PascalCase writes UserName, and the rest is identical. JavaScript uses the first for variables and methods and the second for classes and components, while C# uses PascalCase for methods and properties as well.
Why does 3d model become 3dModel instead of 3DModel?
Capitalisation only affects letters, and the digit 3 has no case, so only the m is raised. Edit the d to uppercase afterwards if you want 3DModel, and check that your target language allows an identifier that starts with a digit.
Do React component names have to start with a capital letter?
Yes. JSX treats a lowercase tag as a built-in HTML element, so <myCard /> renders as an unknown tag rather than your component. Both the component name and the name you import it under must start uppercase, which is why PascalCase dominates in React code.
Related tool:PascalCase Converter