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.
A fixed delimiter splits only at that character: other punctuation is removed and case changes are ignored.
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.
On: each line is converted on its own. Off: all lines form one identifier and a line break separates words.
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
| Input | PascalCase | camelCase | kebab-case | snake_case |
|---|---|---|---|---|
| user-profile-card | UserProfileCard | userProfileCard | user-profile-card | user_profile_card |
| user_profile_card | UserProfileCard | userProfileCard | user-profile-card | user_profile_card |
| userProfileCard | UserProfileCard | userProfileCard | user-profile-card | user_profile_card |
| User Profile Card | UserProfileCard | userProfileCard | user-profile-card | user_profile_card |
| created_at | CreatedAt | createdAt | created-at | created_at |
| api.v2.endpoint | ApiV2Endpoint | apiV2Endpoint | api-v2-endpoint | api_v2_endpoint |
| blog/2024/my-first-post | Blog2024MyFirstPost | blog2024MyFirstPost | blog-2024-my-first-post | blog_2024_my_first_post |
| XMLHttpRequest | XmlHttpRequest | xmlHttpRequest | xml-http-request | xml_http_request |
| iOS app | IOsApp | iOsApp | i-os-app | i_os_app |
| item2name | Item2name | item2name | item2name | item2name |
| item2Name | Item2Name | item2Name | item2-name | item2_name |
| page-2-section | Page2Section | page2Section | page-2-section | page_2_section |
| don't-stop | DontStop | dontStop | dont-stop | dont_stop |
| 2fast-furious | 2FastFurious | 2fastFurious | 2fast-furious | 2fast_furious |
| straße-größe | StraßeGröße | straßeGröße | straße-größe | straß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
| Input | PascalCase | camelCase | kebab-case | snake_case |
|---|---|---|---|---|
| item2name | Item2Name | item2Name | item-2-name | item_2_name |
| item2Name | Item2Name | item2Name | item-2-name | item_2_name |
| v2-api | V2Api | v2Api | v-2-api | v_2_api |
| page-2-section | Page2Section | page2Section | page-2-section | page_2_section |
CONSTANT_CASE, dot.case and Title Case
| Input | CONSTANT_CASE | dot.case | Title Case |
|---|---|---|---|
| my-component_name | MY_COMPONENT_NAME | my.component.name | My Component Name |
| maxRetryCount | MAX_RETRY_COUNT | max.retry.count | Max Retry Count |
| created_at | CREATED_AT | created.at | Created At |
| XMLHttpRequest | XML_HTTP_REQUEST | xml.http.request | Xml 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 toolsCase Converter
Convert text to UPPER CASE, lower case, Title Case, Sentence case, camelCase, PascalCase, snake_case, kebab-case or CONSTANT_CASE in one click.
YAML Validator
Check YAML syntax as you type: line and column of the first error, a JSON view of each document, unknown tags such as !Ref listed, << merge keys optional.
Shell Commands Cheat Sheet
Search or filter 83 common shell commands by level, topic and platform, and copy a name or example. 12 are tagged as Linux tools or not on a default Mac.
SQL to JSON
Turn SQL INSERT statements, or a result table pasted from psql, MySQL or Markdown, into JSON. Quoted values stay strings; numbers, true and NULL get types.
Lorem Ipsum Generator
Generate lorem ipsum placeholder text as paragraphs, sentences or words, up to 100 paragraphs or 5,000 words, with optional HTML paragraph tags.
Regex Tester
Test a JavaScript regular expression on your own text: every match with its numbered and named groups and start and end positions, flag switches and replace.