Case Converter: How It Works
Changing text between cases is trivial for a machine and surprisingly opinionated for a human, because title case is not one rule but several competing ones. This converter handles the mechanical transformations and this page covers which convention to apply where.
The transformations
| Case | Example | Used for |
|---|---|---|
| UPPERCASE | THE QUICK BROWN FOX | Constants, acronyms, emphasis (sparingly) |
| lowercase | the quick brown fox | URLs, email addresses, tags, normalisation |
| Title Case | The Quick Brown Fox | Headlines, book and article titles |
| Sentence case | The quick brown fox | Body text, UI labels, most modern headlines |
| camelCase | theQuickBrownFox | JavaScript and Java variables |
| PascalCase | TheQuickBrownFox | Class names, React components |
| snake_case | the_quick_brown_fox | Python, Ruby, database columns |
| kebab-case | the-quick-brown-fox | URLs, CSS classes, filenames |
Title case is not one rule
Style guides genuinely disagree, and the disagreements are about small words.
| Guide | Capitalises |
|---|---|
| AP | Words of four letters or more; all principal words |
| Chicago | All words except articles, short prepositions and conjunctions |
| APA | Words of four letters or more, plus all major words |
| MLA | All principal words regardless of length |
All four capitalise the first and last word regardless. Under AP, 'A Guide to the Art of War' keeps 'to' and 'the' lowercase; under MLA the same title capitalises 'To'. There is no correct answer outside a chosen style guide — pick one and be consistent, which matters far more than which you pick.
Sentence case has been steadily replacing title case in interfaces and increasingly in headlines. It is easier to read, easier to apply consistently, and avoids the small-word problem entirely.
Cases that carry meaning in code
Programming conventions are not decoration; deviating from them makes code look wrong to anyone reading it. JavaScript uses camelCase for variables and PascalCase for classes and components. Python uses snake_case for variables and functions, PascalCase for classes, and SCREAMING_SNAKE_CASE for constants. CSS uses kebab-case. Databases conventionally use snake_case, partly because unquoted identifiers are case-folded by many engines.
The characters that break naive conversion
- Turkish dotless i. Uppercasing 'i' in Turkish gives 'İ', not 'I'. Locale-unaware conversion has broken real authentication systems.
- German ß uppercases to 'SS' — one character becoming two.
- Acronyms. Naive title case turns 'NASA' into 'Nasa' and 'iPhone' into 'IPhone'.
- Names. McDonald, O'Brien, van der Berg and de la Cruz all defy simple capitalisation rules.
For this reason, never case-normalise a person's name for storage. Store what they typed. Case-fold only for comparison, and use your language's locale-aware function when you do.