Uppercase and Lowercase Converter — When to Use Each Case
Uppercase converter, lowercase converter, title case, sentence case — each has a defined use. Here's when to apply each, and how programming languages handle case transformation.
Converting text case is a 5-second task — paste, click, copy. What takes longer is deciding which case to use in the first place. Uppercase for constants? Title case for headings or sentence case? camelCase for variables or PascalCase?
Use the Case Converter on this site to transform text between uppercase, lowercase, title case, sentence case, camelCase, PascalCase, snake_case, and kebab-case instantly.
The standard text cases
Uppercase (ALL CAPS)
Every character converted to its capital form. hello world → HELLO WORLD.
Use for:
- Abbreviations and acronyms: NASA, JSON, API, HTTP
- Programming constants:
MAX_RETRIES = 3,DEFAULT_TIMEOUT = 30 - Emergency or warning labels: IMPORTANT, WARNING, CAUTION
- Legal emphasis in contracts (though modern style guides discourage this)
- Stylistic emphasis in brand names: IKEA, LEGO
Avoid for:
- Regular prose — ALL CAPS in continuous text is perceived as shouting
- Email subject lines — empirically lower open rates
- User-facing UI labels (use title case or sentence case instead)
Lowercase (all lowercase)
Every character converted to its lowercase form. Hello World → hello world.
Use for:
- URL slugs:
/tools/case-converter/(lowercase, hyphen-separated) - CSS class names and IDs:
.nav-header,#main-content - File and directory names (on case-sensitive file systems):
package.json,main.go - Database column names (convention in PostgreSQL):
created_at,user_id - Programming identifiers in snake_case conventions:
user_name,is_valid
Sentence case
First letter of the first word is uppercase; everything else is lowercase. hello world this is a sentence → Hello world this is a sentence.
Proper nouns and acronyms inside the sentence remain uppercase: The JSON parser failed — “JSON” stays uppercase even though it’s mid-sentence.
Use for:
- Regular prose in body text
- Form labels and UI input placeholders
- Toast/notification messages
- Error messages
- Most body copy
Title case
Each “major” word is capitalized. The rules for which words are “major” depend on which style guide you follow.
AP Style (journalism): Capitalize all words except articles (a, an, the), short prepositions (in, on, at, by, for, of, to, up, as), and coordinating conjunctions (and, but, or, nor, for, so, yet) — unless they’re the first or last word.
The Quick Brown Fox Jumps Over the Lazy Dog✓
Chicago Manual of Style: Similar to AP, but capitalizes prepositions of 4+ letters: “About,” “Into,” “From,” “With.”
APA Style: Capitalize all words of 4+ letters; capitalize shorter words that are verbs (is, are, has, have, do) or adjectives.
True title case (Python’s .title() method): Capitalizes the first letter after any non-alphabetic character — so it's becomes It'S, and mcdonald's becomes Mcdonald'S. This is wrong for most editorial purposes.
Use for:
- Article and blog post headings
- Page titles (
<title>) - Navigation items in desktop layouts
- Modal headers
- Product names
The Case Converter uses AP Style title case, which is correct for most web content.
Programming identifier conventions
camelCase
First word lowercase, subsequent words capitalized. No separators. helloWorld, getUserById, totalWordCount.
Conventions:
- JavaScript/TypeScript: variables, functions, methods
- Java: variables, methods, parameters
- Swift: variables, functions
- Dart: variables, functions
const userName = 'alice';
function getUserById(id) { ... }
const isAuthenticated = true;
PascalCase (UpperCamelCase)
Same as camelCase but the first word is also capitalized. HelloWorld, GetUserById, TotalWordCount.
Conventions:
- Classes and types in virtually all languages:
UserAccount,HttpClient - React components:
<NavBar />,<UserProfile /> - C# methods (in addition to classes):
GetUserById() - TypeScript interfaces (with or without I prefix):
UserProfile,IUserProfile
class UserAccount {
constructor(public name: string) {}
}
interface UserProfile {
id: number;
name: string;
}
snake_case
Words separated by underscores, all lowercase. hello_world, get_user_by_id, total_word_count.
Conventions:
- Python: variables, functions, modules:
user_name,get_user_by_id - Ruby: same as Python
- PostgreSQL: column and table names:
created_at,user_profiles - C: variable and function names in many C projects
- Rust: variables and functions
def get_user_by_id(user_id: int) -> dict:
return {'id': user_id, 'name': 'Alice'}
max_retry_count = 3
SCREAMING_SNAKE_CASE
Uppercase snake_case. MAX_RETRY_COUNT, DEFAULT_TIMEOUT_MS.
Conventions:
- Constants in most languages
- Python: module-level constants by PEP 8 convention
- C/C++: preprocessor macros
- Java:
static finalconstants
MAX_CONNECTIONS = 100
DEFAULT_TIMEOUT_MS = 30_000
API_BASE_URL = 'https://api.example.com'
kebab-case (hyphen-case)
Words separated by hyphens, all lowercase. hello-world, get-user-by-id, total-word-count.
Conventions:
- URL slugs:
/blog/what-is-json/ - CSS class names:
.nav-header,.btn-primary - HTML attributes:
data-user-id,aria-label - CLI flags:
--output-file,--max-retries - File names for web assets:
hero-image.png,app-main.js
<button class="btn-primary" data-action="submit-form">Submit</button>
dot.case
Words separated by dots, all lowercase. Used in:
- Configuration keys:
server.port,database.host - Java package names:
com.example.myapp - Some logging frameworks:
logger.name.here
Case conversion in different languages
Python
text = "hello world from python"
text.upper() # 'HELLO WORLD FROM PYTHON'
text.lower() # 'hello world from python'
text.title() # 'Hello World From Python' (naive — issues with apostrophes)
text.capitalize() # 'Hello world from python' (sentence case — only first char)
text.swapcase() # 'HELLO WORLD FROM PYTHON' (reverses case of each char)
# To camelCase:
words = text.split()
camel = words[0] + ''.join(w.capitalize() for w in words[1:])
# 'helloWorldFromPython'
# To snake_case from camelCase:
import re
snake = re.sub('([A-Z])', r'_\1', 'helloWorldFromPython').lower().lstrip('_')
# 'hello_world_from_python'
JavaScript
const text = 'hello world from javascript';
text.toUpperCase() // 'HELLO WORLD FROM JAVASCRIPT'
text.toLowerCase() // 'hello world from javascript'
// Title case:
text.replace(/\b\w/g, c => c.toUpperCase())
// 'Hello World From Javascript'
// Sentence case:
text.charAt(0).toUpperCase() + text.slice(1)
// 'Hello world from javascript'
// camelCase:
text.split(' ').map((w, i) =>
i === 0 ? w : w.charAt(0).toUpperCase() + w.slice(1)
).join('')
// 'helloWorldFromJavascript'
// snake_case:
text.split(' ').join('_')
// 'hello_world_from_javascript'
// kebab-case:
text.split(' ').join('-')
// 'hello-world-from-javascript'
Unicode case conversion gotchas
The Turkish i problem
In Turkish, the uppercase of i (dotless i) is İ (dotted I), and the lowercase of I (dotted I) is ı (dotless i). JavaScript’s .toUpperCase() and Python’s .upper() use the system locale by default, which causes bugs when processing Turkish text on non-Turkish servers.
'istanbul'.toLocaleUpperCase('tr') // 'İSTANBUL' (correct for Turkish)
'istanbul'.toUpperCase() // 'ISTANBUL' (wrong for Turkish, right for English)
Python has the same issue. For user-facing text in multilingual apps, use locale-aware case conversion:
import locale
locale.setlocale(locale.LC_ALL, 'tr_TR.UTF-8')
'istanbul'.upper() # 'İSTANBUL'
German ß (sharp s)
ß uppercases to SS in most contexts. python: 'straße'.upper() → 'STRASSE'. Some Unicode-aware implementations use the ẞ (U+1E9E) capital sharp s, but this is not universally supported.
Emoji and non-alphabetic characters
Uppercase/lowercase conversion only applies to alphabetic characters. The Case Converter leaves numbers, punctuation, spaces, and emoji unchanged — converting hello 🌍 world! to uppercase gives HELLO 🌍 WORLD!.
Common case conversion bugs
Regex-based PascalCase to snake_case fails on consecutive caps:
HTMLParser → should be html_parser, but naive regex gives h_t_m_l_parser or h_t_m_lparser.
Robust solution:
import re
def pascal_to_snake(name):
# Insert _ before sequences of caps followed by lowercase: HTMLParser → HTML_Parser
s1 = re.sub('([A-Z]+)([A-Z][a-z])', r'\1_\2', name)
# Insert _ before cap preceded by lowercase: camelCase → camel_Case
s2 = re.sub('([a-z\d])([A-Z])', r'\1_\2', s1)
return s2.lower()
pascal_to_snake('HTMLParser') # 'html_parser'
pascal_to_snake('getUserById') # 'get_user_by_id'
pascal_to_snake('JSONData') # 'json_data'
Related tools
- Case Converter — convert between all standard cases instantly
- Word Counter — count words and characters after transformation
- Text Diff — compare original and converted text
Related posts
- camelCase — What It Is and Where to Use It in Programming — camelCase capitalizes the first letter of each word except the first: helloWorld…
- camelCase vs snake_case — Which Naming Convention to Use and When — camelCase and snake_case are the two dominant naming conventions in programming.…
- Kebab Case — What It Is and Where to Use kebab-case — Kebab case uses hyphens between lowercase words: hello-world, user-first-name. I…
Related tool
Convert text between camelCase, PascalCase, snake_case, kebab-case, SCREAMING_CASE, Title Case, sentence case, and more. Bulk mode.
Written by Mian Ali Khalid. Part of the Dev Productivity pillar.