Convert camelCase to PascalCase!

String
Result

Convert camelCase to PascalCase!

Is the variable naming in the code you copied from somewhere else different from your code? Don't worry! It converts variables to your desired naming convention!

Capitalizes the first letter of camelCase names, turning userProfile into UserProfile. PascalCase is the convention for classes, TypeScript types and interfaces, React components and C# members, so this conversion shows up whenever a value-level name has to become a type-level one.

Unlike the other conversions from camelCase, nothing is split here: the existing word boundaries are kept and only the first character changes. That also means acronyms survive intact.

How to use

  1. Select camelCase as the source and PascalCase as the target.
  2. Paste type declarations, a list of names or a code snippet into String.
  3. Copy what appears under Result.

Example

Input (camelCase)
interface userProfile { id: number }
interface orderSummary { total: number }
type paymentMethod = "card" | "bank";
Output (PascalCase)
interface UserProfile { id: number }
interface OrderSummary { total: number }
type PaymentMethod = "card" | "bank";

The interface and type names are capitalized, while id and total are single lowercase words and are not treated as camelCase, so the field names stay as they are.

Supported features

  • Upper-cases only the first letter; the rest of the word is unchanged: paymentMethod → PaymentMethod.
  • Acronyms are preserved: userID → UserID, homeURL → HomeURL.
  • Names with digits keep them: userId2 → UserId2.

Use cases

Fixing type names written in camelCase

Generated or quickly written code sometimes has interface userProfile. Converting the declarations brings them in line with the usual TypeScript lint rule for type names.

Deriving component or class names

From a route or state key such as orderSummary, get the OrderSummary component name, or turn service variable names into class names when extracting them into their own files.

Notes and limitations

  • Every camelCase word in the pasted text is capitalized, including variable and function names that should stay lowercase. Paste only the names you want to change.
  • Words that are entirely lowercase (user, id) are not camelCase and are left alone.

FAQ

Why does userID keep ID here but become user_id on the snake_case page?

Going from camelCase to PascalCase only changes the first character, so the inner capitals are kept exactly as written. Targets that use separators have to lowercase every word, so there ID turns into id.

Is this the same as Title Case?

No. Title Case capitalizes separate words with spaces between them. PascalCase keeps words joined; use the string case converter for titles.