← Back

Case Converter

Convert between camelCase, snake_case and more

Converted results
UPPERCASE
HELLO WORLD EXAMPLE
lowercase
hello world example
Title Case
Hello World Example
camelCase
helloWorldExample
PascalCase
HelloWorldExample
snake_case
hello_world_example
kebab-case
hello-world-example

About Case Converter

This case converter takes one line of English text and shows it in seven common forms at once: UPPERCASE, lowercase, Title Case, and four naming styles used in programming, namely camelCase, PascalCase, snake_case and kebab-case. You do not choose a mode. Type once and every result appears, each with its own copy button. It is handy for renaming variables, tidying English headings, writing URL paths and making file names consistent. Keep in mind that it works on English letters, and Chinese text is not changed. It splits words at spaces, underscores, hyphens and at lowercase-to-uppercase boundaries, and also inside runs of capitals (HTMLParser) and between letters and digits, as explained below.

How to use it

  1. Type or paste one line of English into 'Input text'. The page opens with 'Hello World Example' in the box, which you can overwrite.
  2. The 'Converted results' section lists seven lines straight away: UPPERCASE, lowercase, Title Case, camelCase, PascalCase, snake_case and kebab-case. If the input is empty, each shows an em dash.
  3. Click the copy button at the right of any line to copy only that form.
  4. Click the copy button beside the 'Converted results' heading to copy all seven with their labels, one per line, such as 'UPPERCASE: HELLO WORLD EXAMPLE'.
  5. To convert something else, just edit the box. There is no convert button.

Worked examples

These results come from running the tool's own rules. For 'Hello World Example' you get HELLO WORLD EXAMPLE, hello world example, Hello World Example, helloWorldExample, HelloWorldExample, hello_world_example and hello-world-example. For 'user_profile-pageUrl', which mixes an underscore, a hyphen and camel case, the text is split into four words, user, profile, page and Url, giving camelCase userProfilePageUrl, PascalCase UserProfilePageUrl, snake_case user_profile_page_url and kebab-case user-profile-page-url. So you can convert from any naming style to any other.

How words are split

  • Spaces, underscores and hyphens are all treated as separators, and runs of separators collapse together.
  • A boundary where a lowercase letter is directly followed by an uppercase letter is also a split point, so pageUrl becomes page and Url. A run of capitals followed by a capital-plus-lowercase pair is split before the last capital (HTMLParser becomes HTML and Parser), and letter-digit boundaries are split too (version2Beta becomes version, 2 and Beta).
  • Other characters, such as apostrophes, full stops and Chinese, do not cause a split and stay inside their word. For example, the camelCase result for "it's a dog-friendly cafe" is it'sADogFriendlyCafe, with the apostrophe kept.
  • UPPERCASE and lowercase do no splitting at all. They change the case of the whole text as it is, so spaces, underscores and similar symbols remain.

Supported scope and known limits

  • Single-line text only. The input is a one-line field and is not meant for pasting multi-paragraph articles.
  • An acronym followed directly by a word is split in the usual way (HTMLParser gives html_parser), but two all-capital words joined together cannot be told apart, so HTMLCSS stays one word. Letter-digit boundaries are always split, so utf8 becomes utf_8 and h264 becomes h_264.
  • Title Case separates hyphenated words (dog-friendly becomes Dog Friendly) and keeps small words such as a, the and of lowercase (except the first and last word). These are simple English rules, so for publication-style title capitalization you may still need to adjust by hand.
  • Punctuation stays inside words. 'user.name field' in snake_case becomes user.name_field, with the dot untouched.
  • Scripts without case, such as Chinese and Japanese, are unchanged. In mixed text only the English part changes.
  • Accented letters (such as é) do change case, but the splitting rule only recognises boundaries between the plain letters a-z and A-Z, so a capital following an accented letter may not cause a split.

FAQ: What is the difference between camelCase and PascalCase?

Both join words together with each word capitalized. The difference is the first word: camelCase starts lowercase (helloWorldExample) while PascalCase capitalizes it too (HelloWorldExample). Conventions vary by language. A common one is camelCase for variables and functions and PascalCase for class and component names, but follow your language's and team's style guide.

FAQ: Where are snake_case and kebab-case used?

snake_case is common for Python variable and function names and for database column names. kebab-case is common in URL paths, CSS class names and file names. The tool simply shows both forms and does not judge which suits your case.

FAQ: Why was my acronym not split as I expected?

The rules split where a lowercase letter is followed by an uppercase one, and before the last capital of a run of capitals when a lowercase letter follows it. So HTMLParser becomes HTML and Parser, but two all-capital words written together, such as HTMLCSS, cannot be told apart. Type HTML CSS or html_css before converting.

FAQ: Can it convert a whole file in bulk?

No. It is designed for a single line of text and has no file upload or batch mode. For many identifiers, use your editor's multi-cursor or find-and-replace features and use this tool to double-check individual forms.

Privacy and processing

Conversion happens instantly in your browser. The code sends nothing you type to a server and writes nothing to local storage. The copy buttons use your browser's clipboard feature, so the text only goes to your own clipboard. After a refresh the input returns to the default sample text.