Case Converter

Convert text between uppercase, lowercase, title case, camelCase, snake_case and more

Try an example

Input

Output

Runs locally · Safe to paste secrets
Converted text will appear here…

What Is Text Case Conversion?

Text case conversion is the process of changing the letter casing or word separation pattern of a string. A case converter takes input like "hello world" and transforms it into UPPERCASE, lowercase, Title Case, camelCase, snake_case, kebab-case, or other conventions. The transformation is straightforward for simple ASCII text, but edge cases appear with acronyms ("XMLParser"), locale-specific rules (Turkish dotted I), and mixed-script strings.

Programming languages, file systems, and style guides each enforce their own naming conventions. JavaScript variables typically use camelCase. Python functions and variables follow snake_case per PEP 8. CSS class names use kebab-case. Database columns vary by team, but snake_case dominates in PostgreSQL and MySQL. Switching between these conventions manually is slow and error-prone, especially when renaming across dozens of files.

Case conventions also matter outside of code. Title Case follows rules defined by style guides like the Chicago Manual of Style and APA, where articles and short prepositions stay lowercase unless they start the sentence. Sentence case capitalizes only the first word and proper nouns. American English publishing defaults to Title Case for headlines; most European and tech documentation uses Sentence case instead.

Why Use This Case Converter?

Paste any text and convert it between nine case formats instantly, without installing a VS Code extension or writing a one-off script.

Instant Conversion
Select a case format and see the result immediately. No round-trip to a server, no waiting. Switch between formats to compare output side by side.
🔒
Privacy-First Processing
All transformations run in your browser with JavaScript. Your text stays on your device. Nothing is sent to a server or stored anywhere.
🔄
Nine Formats in One Tool
UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case, kebab-case, and CONSTANT_CASE. One input covers every common convention.
🌍
No Account Required
Open the page and start converting. No signup, no browser extension, no desktop install. Works on any device with a modern browser.

Case Converter Use Cases

Frontend Development
Convert component prop names from snake_case API responses to camelCase for JavaScript objects. Rename CSS classes from camelCase to kebab-case when migrating to a BEM or utility-first naming system.
Backend API Design
Translate field names between conventions when mapping database columns (snake_case) to JSON response keys (camelCase). Verify that serialization layers produce the expected output format.
DevOps and Infrastructure
Generate CONSTANT_CASE environment variable names from descriptive phrases. Convert Terraform resource names between snake_case and kebab-case when aligning with team style guides.
QA and Test Automation
Prepare test fixture data with correctly cased field names. Spot casing mismatches between API contracts and client expectations before they reach production.
Data Engineering
Normalize column headers when importing CSV or Excel files into a database. Convert mixed-case headers like "First Name" into snake_case columns like "first_name" for consistent schema design.
Technical Writing and Documentation
Format code references in documentation with correct casing. Convert plain-English descriptions into PascalCase class names or kebab-case URL slugs for consistency in technical specs.

Case Convention Reference

Each naming convention has specific rules for capitalization and word separation. The table below shows all nine formats this tool supports, with the input phrase "the quick brown fox" as a reference.

CaseRuleExample
UPPERCASEEvery letter capitalizedTHE QUICK BROWN FOX
lowercaseEvery letter lowercasedthe quick brown fox
Title CaseFirst letter of each word capitalizedThe Quick Brown Fox
Sentence caseFirst letter of each sentence capitalizedThe quick brown fox
camelCaseNo separators, first word lowercasetheQuickBrownFox
PascalCaseNo separators, every word capitalizedTheQuickBrownFox
snake_caseWords joined by underscores, all lowercasethe_quick_brown_fox
kebab-caseWords joined by hyphens, all lowercasethe-quick-brown-fox
CONSTANT_CASEWords joined by underscores, all uppercaseTHE_QUICK_BROWN_FOX

camelCase vs snake_case vs kebab-case

These three conventions dominate in software development, but each belongs to a different ecosystem. Choosing the wrong one breaks linters, violates API contracts, or produces inconsistent codebases.

camelCase
Standard for JavaScript and TypeScript variables, function names, and object keys. Java and C# use it for local variables and method parameters. JSON APIs built for JavaScript clients typically use camelCase keys. The first word is lowercase; each subsequent word starts with an uppercase letter.
snake_case
Default for Python (PEP 8), Ruby, Rust, and most SQL databases. C standard library functions also follow this pattern. Words are separated by underscores, all lowercase. CONSTANT_CASE (all uppercase with underscores) is the variant used for constants and environment variables.
kebab-case
Standard for CSS class names, HTML attributes, URL slugs, and CLI flag names (--output-dir). Common in Lisp and Clojure. Words are separated by hyphens, all lowercase. Most programming languages cannot use hyphens in identifiers, so kebab-case is restricted to strings, file names, and markup.

Code Examples

How to convert between case conventions programmatically. Each example covers the most common transformations: camelCase to snake_case, snake_case to camelCase, and basic upper/lower/title conversions.

JavaScript
// camelCase → snake_case
function toSnakeCase(str) {
  return str
    .replace(/([a-z])([A-Z])/g, '$1_$2')
    .replace(/[\s-]+/g, '_')
    .toLowerCase()
}
toSnakeCase('myVariableName')  // → "my_variable_name"
toSnakeCase('kebab-case-str')  // → "kebab_case_str"

// snake_case → camelCase
function toCamelCase(str) {
  return str
    .toLowerCase()
    .replace(/[_-](\w)/g, (_, c) => c.toUpperCase())
}
toCamelCase('my_variable_name')  // → "myVariableName"

// Title Case
function toTitleCase(str) {
  return str.replace(/\w\S*/g, w =>
    w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()
  )
}
toTitleCase('the quick brown fox')  // → "The Quick Brown Fox"
Python
import re

text = "the quick brown fox"

# UPPERCASE / lowercase
text.upper()  # → "THE QUICK BROWN FOX"
text.lower()  # → "the quick brown fox"

# Title Case
text.title()  # → "The Quick Brown Fox"

# camelCase
def to_camel(s):
    words = re.split(r'[\s_-]+', s)
    return words[0].lower() + ''.join(w.capitalize() for w in words[1:])

to_camel("my_variable_name")  # → "myVariableName"

# snake_case from camelCase
def to_snake(s):
    return re.sub(r'([a-z])([A-Z])', r'\1_\2', s).lower()

to_snake("myVariableName")  # → "my_variable_name"

# kebab-case
def to_kebab(s):
    return re.sub(r'([a-z])([A-Z])', r'\1-\2', s).replace('_', '-').lower()

to_kebab("myVariableName")  # → "my-variable-name"
Go
package main

import (
	"fmt"
	"regexp"
	"strings"
)

// camelCase → snake_case
func toSnake(s string) string {
	re := regexp.MustCompile("([a-z])([A-Z])")
	snake := re.ReplaceAllString(s, "${1}_${2}")
	return strings.ToLower(snake)
}

// snake_case → camelCase
func toCamel(s string) string {
	parts := strings.Split(strings.ToLower(s), "_")
	for i := 1; i < len(parts); i++ {
		parts[i] = strings.Title(parts[i])
	}
	return strings.Join(parts, "")
}

func main() {
	fmt.Println(toSnake("myVariableName"))  // → my_variable_name
	fmt.Println(toCamel("my_variable_name")) // → myVariableName
	fmt.Println(strings.ToUpper("hello"))    // → HELLO
	fmt.Println(strings.ToUpper("hello world")) // → HELLO WORLD
}
CLI (bash / sed)
# UPPERCASE
echo "hello world" | tr '[:lower:]' '[:upper:]'
# → HELLO WORLD

# lowercase
echo "HELLO WORLD" | tr '[:upper:]' '[:lower:]'
# → hello world

# camelCase → snake_case (using sed)
echo "myVariableName" | sed 's/\([a-z]\)\([A-Z]\)/\1_\2/g' | tr '[:upper:]' '[:lower:]'
# → my_variable_name

# snake_case → kebab-case
echo "my_variable_name" | tr '_' '-'
# → my-variable-name

Frequently Asked Questions

What is the difference between camelCase and PascalCase?
camelCase starts with a lowercase letter (myVariable), while PascalCase starts with an uppercase letter (MyVariable). In JavaScript, camelCase is used for variables and functions; PascalCase is used for class names and React component names. C# uses PascalCase for public methods and properties. The only structural difference is the first character.
How do I convert camelCase to snake_case in JavaScript?
Insert an underscore before each uppercase letter using a regex, then lowercase the result: str.replace(/([a-z])([A-Z])/g, '$1_$2').toLowerCase(). This handles standard camelCase. For strings with consecutive uppercase letters like "XMLParser", you need an additional regex pass to split runs of capitals correctly.
Why does Python use snake_case instead of camelCase?
PEP 8, Python's official style guide published in 2001, chose snake_case for functions and variables because Guido van Rossum and the core team considered it more readable at a glance. Studies like the one by Binkley et al. (2009) found that snake_case identifiers were recognized faster by programmers than camelCase in certain reading tasks. The convention is enforced by linters like flake8 and pylint.
Is Title Case the same as capitalizing every word?
Simple Title Case capitalizes the first letter of every word, and that is what this tool does. Formal Title Case (AP, Chicago, APA) has additional rules: articles (a, an, the), short conjunctions (and, but, or), and short prepositions (in, on, at) stay lowercase unless they are the first or last word. Formal title casing requires a dictionary lookup, not just a character-level transformation.
Can this tool handle Unicode and non-Latin scripts?
The tool uses JavaScript's built-in toUpperCase() and toLowerCase() methods, which follow Unicode casing rules defined in the Unicode Standard (Chapter 3, Section 3.13). This correctly handles accented characters (e to E), German eszett (ss to SS), and Greek letters. However, locale-specific rules like Turkish casing (where lowercase i should uppercase to İ with a dot, not I) depend on the browser's locale setting, not the tool's.
What is CONSTANT_CASE used for?
CONSTANT_CASE (also called SCREAMING_SNAKE_CASE) is used for constants and environment variables. In JavaScript: const MAX_RETRIES = 3. In Python: MAX_RETRIES = 3 (by convention, since Python has no true constants). In shell scripts: export DATABASE_URL=.... The all-caps style signals that a value should not be reassigned after initialization.
How do I choose the right case convention for my project?
Follow the dominant convention for your language and framework. JavaScript/TypeScript: camelCase for variables, PascalCase for classes and components. Python: snake_case for functions and variables, PascalCase for classes. CSS: kebab-case. SQL: snake_case for columns and tables. REST API JSON keys: match your frontend language (camelCase for JS clients, snake_case for Python clients). When in doubt, check the linter configuration or .editorconfig in your project root.