Skip to main content
CalcChef

Slug to Pascal Case Converter

Convert a slug, kebab-case, snake_case or camelCase name to PascalCase, camelCase, CONSTANT_CASE and four other forms: user-profile-card is UserProfileCard. How it works

Use the Slug to Pascal Case Converter

Up to 10,000 characters. The text is saved in this browser until you clear it.

PascalCase
—
camelCase
—
kebab-case
—
snake_case
—
CONSTANT_CASE
—
dot.case
—
Title Case
—

A fixed delimiter splits only at that character: other punctuation is removed and case changes are ignored.

Preserve NumbersOn

On: digits stay attached to the letters they touch (item2name becomes Item2name). Off: each run of digits is its own word (Item2Name, item-2-name). Digits are kept either way.

Line-by-Line ModeOn

On: each line is converted on its own. Off: all lines form one identifier and a line break separates words.

Characters: 0Words: 0Detected Delimiter: none

About the Slug to Pascal Case Converter

user-profile-card is UserProfileCard in PascalCase, userProfileCard in camelCase and user_profile_card in snake_case. The converter splits your text into words at hyphens, underscores, spaces, dots, other punctuation and lower-to-upper case changes, then writes seven forms at once: PascalCase, camelCase, kebab-case, snake_case, CONSTANT_CASE, dot.case and Title Case.

Conversions with Auto-detect and Preserve Numbers on

InputPascalCasecamelCasekebab-casesnake_case
user-profile-cardUserProfileCarduserProfileCarduser-profile-carduser_profile_card
user_profile_cardUserProfileCarduserProfileCarduser-profile-carduser_profile_card
userProfileCardUserProfileCarduserProfileCarduser-profile-carduser_profile_card
User Profile CardUserProfileCarduserProfileCarduser-profile-carduser_profile_card
created_atCreatedAtcreatedAtcreated-atcreated_at
api.v2.endpointApiV2EndpointapiV2Endpointapi-v2-endpointapi_v2_endpoint
blog/2024/my-first-postBlog2024MyFirstPostblog2024MyFirstPostblog-2024-my-first-postblog_2024_my_first_post
XMLHttpRequestXmlHttpRequestxmlHttpRequestxml-http-requestxml_http_request
iOS appIOsAppiOsAppi-os-appi_os_app
item2nameItem2nameitem2nameitem2nameitem2name
item2NameItem2Nameitem2Nameitem2-nameitem2_name
page-2-sectionPage2Sectionpage2Sectionpage-2-sectionpage_2_section
don't-stopDontStopdontStopdont-stopdont_stop
2fast-furious2FastFurious2fastFurious2fast-furious2fast_furious
straße-größeStraßeGrößestraßeGrößestraße-größestraße_größe

Each word is lower-cased and its first letter capitalized, so acronyms lose their capitals. A result that starts with a digit, such as 2FastFurious, gets a note on the page.

The same kind of input with Preserve Numbers off

InputPascalCasecamelCasekebab-casesnake_case
item2nameItem2Nameitem2Nameitem-2-nameitem_2_name
item2NameItem2Nameitem2Nameitem-2-nameitem_2_name
v2-apiV2Apiv2Apiv-2-apiv_2_api
page-2-sectionPage2Sectionpage2Sectionpage-2-sectionpage_2_section

CONSTANT_CASE, dot.case and Title Case

InputCONSTANT_CASEdot.caseTitle Case
my-component_nameMY_COMPONENT_NAMEmy.component.nameMy Component Name
maxRetryCountMAX_RETRY_COUNTmax.retry.countMax Retry Count
created_atCREATED_ATcreated.atCreated At
XMLHttpRequestXML_HTTP_REQUESTxml.http.requestXml Http Request

Auto-detect with Preserve Numbers on. CONSTANT_CASE suits constants and environment variables; Title Case capitalizes every word, including short ones such as of and the.

Frequently asked questions

How do I convert kebab-case to camelCase?
Paste it in: user-profile-card gives userProfileCard. The first word stays in lower case, each later word starts with a capital, and the hyphens go.
What is the difference between PascalCase and camelCase?
Only the first letter. PascalCase capitalizes every word, as in UserProfileCard; camelCase leaves the first word in lower case, as in userProfileCard. Neither has separators.
Why does XMLHttpRequest become XmlHttpRequest?
Every word is lower-cased and then capitalized, so acronyms lose their capitals: XMLHttpRequest splits into XML, Http and Request, and iOS app becomes IOsApp. Fix acronyms by hand where your style guide keeps them in capitals.
How are numbers handled?
Preserve Numbers decides whether digits split a word. On (the default), digits stay attached to the letters next to them, so item2name is one word: Item2name, item2name. Off, every run of digits is a word of its own, so item2name is three words: Item2Name, item-2-name. Digits are never dropped. A result that starts with a digit, such as 2FastFurious, gets a note, because most languages do not accept it as a name.
When should I use PascalCase, camelCase, snake_case or kebab-case?
It depends on the language and the place. React component names must start with a capital, so components are PascalCase; JavaScript variables and properties are usually camelCase. Python’s PEP 8 uses CapWords (PascalCase) for classes and snake_case for functions and variables, and SQL columns are often snake_case. URLs, file names and CSS class names usually use kebab-case, since hyphens read well and need no escaping there.
Can I convert a list of names at once?
Yes. Put one name per line with Line-by-Line Mode on, and each line is converted on its own. With it off, all lines make one name: item2name and foo_bar on two lines give Item2nameFooBar.

Related Tools

View all tools