Aa Case Converter
Convert text between camelCase, PascalCase, snake_case, kebab-case, UPPER_CASE, and more. Instant conversion for variable names and identifiers. Free online case converter.
How to Use
Paste your text
Type or paste any text — sentences, variable names, or any format. The tool detects the input format automatically.
All formats update instantly
camelCase, PascalCase, snake_case, kebab-case, SCREAMING_SNAKE, Title Case, UPPERCASE, lowercase and more are shown at once.
Copy any format
Click the Copy button next to any format to copy it to your clipboard.
Frequently Asked Questions
Complete Guide: Case Converter
Naming conventions are one of the most fundamental aspects of code style, and different languages, frameworks, and contexts each have strong conventions. A case converter lets you instantly transform text between any naming style — essential when mapping between systems that use different conventions, like converting database column names to JSON API keys.
The Major Naming Conventions
- camelCase — First word lowercase, subsequent words capitalized. No separators. Example:
getUserProfile. Used in: JavaScript variables and functions, Java, Swift, Kotlin, JSON keys. - PascalCase (UpperCamelCase) — Every word capitalized. No separators. Example:
UserProfileService. Used in: PHP classes, C# types, TypeScript interfaces, React components. - snake_case — All lowercase, words separated by underscores. Example:
user_profile_id. Used in: Python variables and functions, Ruby, database column names, Rust variables. - kebab-case (hyphen-case) — All lowercase, words separated by hyphens. Example:
user-profile-card. Used in: CSS class names, HTML attributes, URL slugs, npm package names. - SCREAMING_SNAKE_CASE (UPPER_SNAKE_CASE) — All uppercase, words separated by underscores. Example:
MAX_RETRY_COUNT. Used in: constants in Python, Java, C/C++, environment variables, SQL. - Title Case — First letter of each significant word capitalized. Example:
The Quick Brown Fox. Used in: headings, book titles, UI labels.
When Each Convention is Used
Knowing which convention to use in which context prevents code review comments and style inconsistencies:
// JavaScript — camelCase for variables, PascalCase for classes
const userName = 'alice';
class UserProfile { }
// Python — snake_case for everything except classes
user_name = 'alice'
class UserProfile:
pass
/* CSS — kebab-case */
.user-profile-card { color: red; }
-- SQL — UPPER_SNAKE for keywords, snake_case for identifiers
SELECT user_id, first_name FROM user_profiles WHERE is_active = TRUE;
Converting Database Column Names to API JSON Keys
A common real-world use case: your database uses snake_case column names (first_name, created_at), but your REST API returns camelCase JSON keys (firstName, createdAt). Many ORMs handle this automatically, but when they don't, you need a reliable conversion function.
Regex Patterns for Word Boundary Splitting
Programmatic case conversion relies on correctly identifying word boundaries. Different input formats require different splitting strategies:
// Split snake_case or kebab-case
const words = 'user_profile_id'.split(/[-_]+/);
// Split camelCase or PascalCase
const words2 = 'userProfileId'.split(/(?=[A-Z])/);
// Universal splitter (handles all common formats)
function toWords(str) {
return str
.replace(/([a-z])([A-Z])/g, '$1 $2')
.replace(/[-_]+/g, ' ')
.toLowerCase()
.split(' ')
.filter(Boolean);
}
Unicode-Aware Case Conversion Pitfalls
Standard toUpperCase() and toLowerCase() handle most Latin characters correctly, but some languages have special rules. The most famous example is Turkish: the dotted İ (capital I with dot) and dotless ı (lowercase i without dot) are separate letters. 'i'.toUpperCase() returns I in English locale but should return İ in Turkish locale:
// Use locale-aware methods for Turkish content
'istanbul'.toLocaleUpperCase('tr-TR'); // → 'İSTANBUL'
'İSTANBUL'.toLocaleLowerCase('tr-TR'); // → 'istanbul'
- Generate URL-safe slugs from any text with the Slug Generator.
- Analyze and count words in your text with the Word Counter.