HomeFormattersTextCase Converter

Case Converter

Text

Convert text between camelCase, PascalCase, snake_case, kebab-case, Title Case, UPPER, and lower case instantly in your browser — nothing is uploaded anywhere.

What is a Case?

The Case Converter is a text formatting tool that instantly rewrites any phrase or identifier into your chosen capitalisation style — camelCase, PascalCase, snake_case, kebab-case, Title Case, UPPER CASE, or lower case. It is built for developers, writers, and data professionals who need to rename variables, generate CSS class names, prepare headings, or normalise database column names without manually editing every word.

Every programming language and style guide has its own naming convention. JavaScript uses camelCase for variables (totalAmount) and PascalCase for classes (TotalAmount). Python favours snake_case (total_amount). CSS and HTML prefer kebab-case (total-amount). Switching between these formats by hand is slow, error-prone, and interrupts your flow — especially when converting a multi-word phrase like "total investment amount" into each style.

The Case Converter solves this by detecting word boundaries automatically. It recognises spaces, hyphens, underscores, and camelCase transitions, so it can correctly parse getUserFullName, get-user-full-name, and get_user_full_name as the same four words and then reformat them into whichever style you need.

All conversion runs entirely in your browser. Nothing you type is sent to a server or stored anywhere — making it safe to use with proprietary variable names, internal identifiers, or sensitive schema fields. You can also try the Text to Slug Converter if you need URL-safe lowercase output with hyphen separators.

How to use this Case calculator

  1. Paste your text into the Input Text box — this can be a plain English phrase, an existing identifier in any case style, or a list of words.
  2. Open the Target Case dropdown and select the style you want: camelCase, PascalCase, snake_case, kebab-case, Title Case, UPPER CASE, or lower case.
  3. The Converted Text output updates instantly — no button press needed.
  4. Click the Copy button beneath the output to copy the result to your clipboard.
  5. Switch the Target Case dropdown to compare how the same phrase looks in different styles without re-pasting.

Formula & Methodology

The converter splits the input on all recognised word boundaries before rejoining in the target format. Word boundaries are detected at:

- Whitespace runs (spaces, tabs, newlines)
- Underscores (_) and hyphens (-)
- camelCase transitions: a lowercase letter immediately followed by an uppercase letter (a→B), and a run of uppercase letters followed by an uppercase-then-lowercase pair (ABCDefABC + Def)

Once split into a word array, the converter applies the target case rules:

| Target | Rule |
|---|---|
| camelCase | First word all-lowercase; subsequent words capitalise first letter, rest lowercase |
| PascalCase | Every word capitalises first letter, rest lowercase |
| snake_case | All words lowercase, joined with _ |
| kebab-case | All words lowercase, joined with - |
| Title Case | Every word capitalises first letter, rest lowercase, joined with space |
| UPPER CASE | text.toUpperCase() applied to entire input |
| lower case | text.toLowerCase() applied to entire input |

Before: getUserFullName
After (snake_case): get_user_full_name

Before: monthly investment amount
After (camelCase): monthlyInvestmentAmount
Frequently Asked Questions
What is a case converter?
A case converter is a tool that transforms text from one capitalisation style to another — for example, turning a plain English sentence into camelCase for use as a JavaScript variable name, or into snake_case for a Python function. It automates what would otherwise be tedious manual editing, especially when renaming identifiers across a codebase. The Case Converter on thecalcu.com supports seven common styles: camelCase, PascalCase, snake_case, kebab-case, Title Case, UPPER CASE, and lower case.
What is the difference between camelCase and PascalCase?
Both camelCase and PascalCase run words together without spaces, but they differ in how the first word is handled. In camelCase, the first word starts with a lowercase letter (e.g. `getUserName`), whereas in PascalCase every word — including the first — starts with an uppercase letter (e.g. `GetUserName`). camelCase is conventional for variables and functions in JavaScript, Java, and Swift; PascalCase is standard for class names and React component names.
What is snake_case used for?
snake_case separates words with underscores and keeps all letters lowercase — for example, `monthly_investment_amount`. It is the dominant naming convention in Python for variable and function names, as well as in database column names and URL slugs where hyphens might be ambiguous. Some configuration file formats (YAML, TOML) also favour snake_case for readability.
What is kebab-case and where is it used?
kebab-case joins words with hyphens and uses all lowercase letters, producing names that look like words on a skewer — for example, `primary-button-color`. It is the standard convention for HTML class names, CSS custom properties, URL paths, and npm package names. Unlike camelCase, kebab-case is immediately readable in source without any special tooling.
How do I convert text between cases?
Paste your text into the Input Text box, then choose your target case from the Target Case dropdown. The converter updates the output instantly — no button press required. Click the Copy button below the output to copy the result to your clipboard.
Can I convert multi-line text?
Yes. The Case Converter processes all words in the pasted text together, treating newlines as word separators. This works well for converting a list of words or a short paragraph. For converting identifiers that already have a mix of camelCase and snake_case, the tool first splits on all known word boundaries before rejoining in the target case.
Can this fix incorrectly cased variable names?
Yes — that is one of its most common uses. If you have a variable like `getUserName` that you want to rename to `get_user_name` for a Python port, paste it in, choose snake_case, and copy the result. For renaming across a codebase you will still need to search-and-replace in your editor, but the converter gives you the correctly cased target string instantly.
Is my text uploaded anywhere?
No. All conversion happens entirely in your browser using JavaScript. The text you paste is never sent to a server, stored, or logged. You can use the Case Converter with sensitive variable names, internal identifiers, or proprietary content without any privacy risk.
Does this work offline?
The tool runs client-side, so once the page has loaded, it works without an internet connection. If you refresh the page while offline it will not load, but an already-open tab will continue to function normally.
What happens to special characters and numbers?
Numbers are treated as part of the preceding word — `user123` stays as `user123` rather than being split. Special characters such as `@`, `#`, and `!` are treated as word separators and removed in the output, since they are not valid inside most identifier naming conventions. Accented characters (é, ü) are passed through unchanged.
Can I use this to generate CSS class names?
Yes — kebab-case is exactly the right format for CSS class names. Paste a descriptive phrase like `primary call to action button`, choose kebab-case, and get `primary-call-to-action-button` in one click. You can also use the [Text to Slug Converter](/text-to-slug-formatter/) if you need URL-safe output with additional cleaning.
What is Title Case?
Title Case capitalises the first letter of every word — for example, `the quick brown fox` becomes `The Quick Brown Fox`. It is used for headings, titles, and product names. Note that this tool applies simple Title Case (all words capitalised), not the editorial convention that keeps prepositions and conjunctions lowercase.