Case Converter – Change Text to UPPERCASE, lowercase & More
All conversions happen instantly in your browser. The tool uses standard JavaScript string manipulation and regular expressions to handle complex formatting like camelCase and sentence case.
What Is a Case Converter?
A case converter is a text utility that changes the capitalization of a string of text. It is an essential tool for writers, students, and developers. If you accidentally leave Caps Lock on while typing a paragraph, a case converter fixes it in one click. If you are writing code in JavaScript, you might need to convert a variable name to camelCase, or if you are writing Python, you might need snake_case.
This free online tool provides ten different text transformations. It can make everything uppercase, lowercase, title case, sentence case, or convert strings into the specific naming conventions required for programming.
How to Use This Case Converter
- Paste or type your text. Enter the text you want to convert into the "Original Text" box on the left.
- Select a conversion type. Click one of the ten buttons below the text boxes (e.g., UPPERCASE, Title Case, camelCase). The "Converted Text" box on the right will instantly update with the result.
- Try different formats. You can click multiple buttons in a row to see how the same text looks in different cases. The active button will highlight in blue.
- Copy the result. Click the "Copy Result" button to save the converted text to your clipboard. The button will briefly change to "Copied!" to confirm the action.
- Clear the fields. Click "Clear All" to empty both text boxes and start over.
The Algorithms Behind the Conversions
The tool uses regular expressions (RegEx) and JavaScript string methods to transform the text based on the selected mode.
UPPERCASE: Converts every letter in the string to uppercase using `toUpperCase()`.
lowercase: Converts every letter to lowercase using `toLowerCase()`.
Title Case: Converts the text to lowercase, then capitalizes the first letter of every word.
Sentence case: Converts the entire text to lowercase, then capitalizes the first letter of the string and the first letter after any sentence-ending punctuation (. ! ?).
camelCase: Removes all spaces and special characters, lowercases the first word, and capitalizes the first letter of every subsequent word (e.g., "this is text" becomes "thisIsText").
PascalCase: Similar to camelCase, but the first letter of the very first word is also capitalized (e.g., "ThisIsText").
snake_case: Converts the text to lowercase, removes punctuation, and replaces spaces with underscores (e.g., "this is text" becomes "this_is_text").
kebab-case: Identical to snake_case, but replaces spaces with hyphens (e.g., "this_is_text" becomes "this-is-text").
aLtErNaTiNg cAsE: Iterates through the string and toggles the case of every alphabetical character, ignoring spaces and numbers.
InVeRsE cAsE: Swaps the case of every letter. Uppercase letters become lowercase, and lowercase letters become uppercase.
Common Use Cases at a Glance
Here is a quick reference of when you might need each case type.
| Case Type | Example | Common Use Case |
|---|---|---|
| Title Case | The Quick Brown Fox | Headlines, book titles, blog post headings. |
| Sentence case | The quick brown fox | Standard paragraphs, emails, normal writing. |
| camelCase | theQuickBrownFox | JavaScript variables, JSON keys, Java methods. |
| PascalCase | TheQuickBrownFox | C# properties, React components, class names. |
| snake_case | the_quick_brown_fox | Python variables, database column names, URLs. |
| kebab-case | the-quick-brown-fox | CSS class names, URL slugs, HTML attributes. |
Worked Examples
Example 1: Fixing accidental caps lock
You type: "I FORGOT TO TURN OFF CAPS LOCK FOR THIS WHOLE PARAGRAPH."
You click "Sentence case" or "lowercase". The tool outputs: "I forgot to turn off caps lock for this whole paragraph." This saves you from having to retype it.
Example 2: Creating a CSS class name
You have a title: "Main Navigation Button".
You click "kebab-case". The tool outputs: "main-navigation-button". This is ready to be pasted directly into your CSS file.
Example 3: Creating a Python variable
You have a string: "Total Price Before Tax".
You click "snake_case". The tool outputs: "total_price_before_tax". This is now a valid Python identifier.
Five Text Formatting Mistakes That Cost Time
- Using Title Case in body text. Title case is great for headings, but if you use it for whole paragraphs, it makes the text very difficult to read. Always use Sentence case for body copy.
- Manually converting variable names. Developers lose hours manually adding underscores or capitalizing letters when switching between languages (e.g., from a Python backend to a JavaScript frontend). Always use a case converter.
- Forgetting about the first letter in camelCase. A common mistake in JavaScript is capitalizing the first letter of a variable name (PascalCase) when it should be lowercase (camelCase). The converter handles this automatically.
- Assuming acronyms stay uppercase. In Title Case, an acronym like "NASA" might get converted to "Nasa" depending on the algorithm. If you need strict acronym preservation, you might need to adjust manually.
- Pasting with hidden characters. Sometimes copying from Word or PDFs adds hidden formatting characters. The converter strips most punctuation for programming cases, but stray invisible characters can still cause errors in code if not caught.
Frequently Asked Questions
What is Title Case?
Title Case is a capitalization style where the first letter of every major word is capitalized. It is commonly used for book titles, article headlines, and movie titles.
What is the difference between camelCase and PascalCase?
camelCase starts with a lowercase letter (like myVariableName), while PascalCase starts with an uppercase letter (like MyVariableName). Both remove spaces and capitalize the first letter of subsequent words.
Why are snake_case and kebab-case used?
snake_case (using underscores) is the standard naming convention in Python and SQL. kebab-case (using hyphens) is the standard in CSS, HTML, and URL slugs because search engines prefer hyphens over underscores in URLs.
Does the converter change numbers?
No. Numbers are left exactly as they are in all conversion modes. Only alphabetical characters are affected by the case changes.
How do I convert a whole paragraph to sentence case?
Paste the paragraph into the input box and click "Sentence case". The tool will lowercase everything, then capitalize only the first letter of each sentence based on periods, exclamation marks, and question marks.
What happens to punctuation in camelCase?
For programming cases (camelCase, PascalCase, snake_case, kebab-case), the tool removes all commas, periods, and special characters, treating them as word boundaries before joining the words together.
Can I use this for coding variable names?
Yes. The tool is specifically designed to help developers quickly format variable names, CSS classes, and database columns correctly according to each language's naming conventions.
Does the tool work on mobile?
Yes. The interface is fully responsive. The text boxes stack vertically on small screens, and the conversion buttons wrap to fit the screen width.
Related Calculators
- Word Counter — count words, characters, sentences, and reading time.
- Percentage Calculator — calculate percentages, increases, and decreases.
- Scientific Calculator — advanced math with trigonometry and logarithms.
- Age Calculator — calculate exact age from a date of birth.
- BMI Calculator — check body mass index from height and weight.
- Compound Interest Calculator — see how investments grow over time.