Text Case Converter - camelCase, snake_case & More Online
Convert text between camelCase, snake_case, PascalCase, kebab-case, CONSTANT_CASE, Title Case, and more. Transform variable names and text instantly.
Enter text above to see conversions
Frequently Asked Questions
What is a case converter?
A case converter is an online tool that transforms text between different naming conventions and capitalization styles. It supports programming formats like camelCase, snake_case, PascalCase, kebab-case, and CONSTANT_CASE, as well as natural language formats like Title Case, Sentence case, UPPERCASE, and lowercase.
How do I use this case converter?
Simply type or paste your text into the input area. All supported case formats are computed and displayed simultaneously in real-time. Each output format has its own copy button. Click the copy button next to the format you need.
Is my text data safe?
All text processing is performed 100% client-side in your browser using JavaScript. No text is transmitted to any server. Your text never leaves your device.
What is the difference between camelCase, PascalCase, and snake_case?
camelCase starts with a lowercase letter and capitalizes subsequent words (e.g., myVariableName). PascalCase capitalizes the first letter of every word (e.g., MyClassName). snake_case uses all lowercase with underscores between words (e.g., my_variable_name). camelCase is standard in JavaScript, PascalCase for React components, and snake_case for Python.
When should I use kebab-case vs. snake_case?
kebab-case uses hyphens (e.g., my-component-name) and is standard for CSS class names, HTML attributes, and URL slugs. snake_case uses underscores (e.g., my_variable_name) and is standard in Python, Ruby, Rust, and SQL database columns.
What is CONSTANT_CASE?
CONSTANT_CASE converts all letters to uppercase and separates words with underscores (e.g., MAX_RETRY_COUNT). It is the universal convention for constants and environment variables across virtually all programming languages.
How does the tool detect the input format?
The tool analyzes the input text pattern to detect its current case format. It checks for separator characters (underscores, hyphens, dots, slashes) and letter case patterns (lowercase-to-uppercase transitions for camelCase/PascalCase).
Can this tool handle multi-line text?
Yes. You can paste multiple lines of text, and the conversions will be applied to the entire text. This is useful for converting lists of variable names, database columns, or API field names.
Code Examples
function splitIntoWords(input) {
return input
.replace(/([a-z])([A-Z])/g, '$1 $2')
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')
.replace(/[_\-./]/g, ' ')
.split(/\s+/)
.filter(w => w);
}
const toCamelCase = s =>
splitIntoWords(s)
.map((w, i) => i === 0 ? w.toLowerCase()
: w[0].toUpperCase() + w.slice(1).toLowerCase())
.join('');
const toSnakeCase = s =>
splitIntoWords(s).map(w => w.toLowerCase()).join('_');
const toKebabCase = s =>
splitIntoWords(s).map(w => w.toLowerCase()).join('-');
console.log(toCamelCase('my_variable_name')); // myVariableName
console.log(toSnakeCase('myVariableName')); // my_variable_name
console.log(toKebabCase('MyClassName')); // my-class-name