String Case Conventions Explained: camelCase, PascalCase, snake_case, kebab-case, and Title Case Guide
Case Converter
Convert variables, database schemas, and article titles between 21 standard case formats with instant multi-line batch export.
Why String Case Conventions Matter
In computing, spaces and punctuation symbols are syntactic delimiters. You cannot define a variable named user profile settings or serve a REST endpoint at /user profile settings.
To overcome this constraint without sacrificing human readability, software architects and standards committees developed casing conventions. Each convention provides a deterministic algorithm for joining compound words.
Failing to adhere to standard casing causes:
- Linter & Compiler Failures: Static analysis tools (ESLint, Flake8, Clippy, Roslyn) flag convention violations.
- Serialization Desynchronization: JSON payloads serialized from Python (
user_id) fail to bind cleanly to JavaScript models expectinguserId. - Database Query Errors: Case-sensitive SQL engines (PostgreSQL) require quoted identifiers (
"userId") if snake_case standards (user_id) are violated.
Complete Taxonomy: 21 Case Formats Breakdown
1. Programming & Software Identifiers
| Case Name | Delimiter Pattern | Example Output | Primary Use Cases |
|---|---|---|---|
| camelCase | Lowercase first word, uppercase following words | userProfileSettings | JavaScript, TypeScript, Java, C# variables & methods |
| PascalCase | Capitalize every word, no spaces | UserProfileSettings | Classes, TypeScript types, React components, C# structs |
| snake_case | Lowercase words joined by underscores | user_profile_settings | Python (PEP 8), Rust, Ruby, PostgreSQL/MySQL columns |
| CONSTANT_CASE | Uppercase words joined by underscores | USER_PROFILE_SETTINGS | Global constants, environment variables, Redux actions |
| kebab-case | Lowercase words joined by hyphens | user-profile-settings | URL slugs, CSS class names, HTML attributes, npm packages |
| SCREAMING-KEBAB-CASE | Uppercase words joined by hyphens | USER-PROFILE-SETTINGS | Lisp dialects, command-line arguments, Makefile variables |
| Train-Case | Capitalized words joined by hyphens | User-Profile-Settings | HTTP headers (Content-Type, X-Forwarded-For) |
| Ada_Case | Capitalized words joined by underscores | User_Profile_Settings | Ada programming, VHDL, legacy enterprise SQL schemas |
| dot.case | Lowercase words joined by periods | user.profile.settings | Property accessor paths, Java package names, config keys |
| path/case | Lowercase words joined by forward slashes | user/profile/settings | REST API routes, Unix file paths, URL endpoints |
| windows\path\case | Lowercase words joined by backslashes | user\profile\settings | Windows filesystem paths, UNC resource naming |
| flatcase | All lowercase words concatenated with no delimiter | userprofilesettings | Package names, Go package directories, URL subdomains |
| UPPERFLATCASE | All uppercase words concatenated with no delimiter | USERPROFILESETTINGS | Hardware register labels, assembly mnemonics |
2. Editorial & Document Formats
| Format | Capitalization Rule | Example Output | Application |
|---|---|---|---|
| Title Case | Capitalize major words; lowercase articles & prepositions | User Profile Settings | Headlines, book titles, UI navigation menus |
| Capitalized Case | Capitalize the first letter of every word indiscriminately | User Profile Settings | Table headers, formal certificates, contact forms |
| Sentence case | Capitalize only the first letter of the first word | User profile settings | Standard prose, body copy, alert messages |
| UPPERCASE | All characters capitalized | USER PROFILE SETTINGS | Warnings, acronyms, high-priority visual badges |
| lowercase | All characters lowercase | user profile settings | Text normalization, search indexing, email addresses |
3. Stylistic & Novelty Cases
| Format | Pattern | Example Output | Application |
|---|---|---|---|
| alternating case | Alternates lower and upper letters (aLtErNaTiNg) | uSeR PrOfIlE SeTtInGs | Mocking SpongeBob meme, casual communication |
| inverse case | Inverts existing casing (upper becomes lower, lower becomes upper) | uSER pROFILE sETTINGS | Caps Lock accidental inversion recovery |
| random case | Randomly toggles character casing | uSeR pROfILe SeTTinGs | Fuzz testing, captcha verification routines |
Language Standards Matrix: Who Uses What?
Different programming ecosystems enforce strict casing rules in their official style guides:
| Ecosystem | Variables & Functions | Classes & Types | Constants | Database Columns | URLs & Files |
|---|---|---|---|---|---|
| JavaScript / TypeScript | camelCase | PascalCase | CONSTANT_CASE | snake_case (DB) | kebab-case.ts |
| Python (PEP 8) | snake_case | PascalCase | CONSTANT_CASE | snake_case | snake_case.py |
| Rust | snake_case | PascalCase | CONSTANT_CASE | snake_case | snake_case.rs |
| Go (Golang) | mixedCaps / camelCase | ExportedPascal | CONSTANT_CASE | snake_case | lowercase.go |
| C# / .NET | camelCase (local/private) | PascalCase | PascalCase | snake_case / PascalCase | PascalCase.cs |
| SQL (ANSI / Postgres) | snake_case | snake_case | CONSTANT_CASE | snake_case | snake_case.sql |
The Acronym Dilemma: getHTMLParser vs getHtmlParser
One of the most contentious topics in software engineering is handling acronyms (such as HTML, XML, URL, ID, and JSON) within camelCase or PascalCase identifiers.
The Consecutive Capitals Trap
Consider the identifier:
// Ambiguous: Is the identifier XMLHTTP + Request or XML + HTTPRequest?
const XMLHTTPRequest = ...;
// Ambiguous: Does it mean parse + JSON + Data or parse + JSONData?
function parseJSONData() { ... }
Modern Industry Recommendation
Modern style guides (including Google TypeScript Style Guide and Microsoft .NET Framework Design Guidelines) recommend treating multi-letter acronyms like ordinary words:
- ✅ Recommended:
getHtmlParser(),parseJsonData(),userId,oauthToken - ⚠️ Legacy/Tolerated:
getHTMLParser(),parseJSONData(),userID,oAuthToken
When converting to delimited formats (snake_case or kebab-case), an intelligent word splitter must separate acronym boundaries:
getHTMLParser→["get", "HTML", "Parser"]→get_html_parser(clean)- Rather than naive splitting:
get_h_t_m_l_parser(broken)
Batch Multi-Line Conversion Workflow
In enterprise workflows, developers frequently need to convert hundreds of database table columns or JSON API schemas into TypeScript interfaces or Python models.
Instead of re-typing each identifier manually:
- Open the Toolbox Case Converter.
- Switch to Batch Multi-Line List mode.
- Paste your raw database columns or variable names (one per line).
- Select the target casing format (e.g.
camelCasefor TypeScript orsnake_casefor Python). - Enable Trim whitespace and Skip empty lines.
- Export the result as
.txt, a JSON key-value mapping file ({ "original_key": "convertedKey" }), or a CSV spreadsheet.
Frequently Asked Questions
What is the difference between camelCase and PascalCase? ▼
Both conventions join compound words without spaces and capitalize the first letter of each subsequent word. The sole difference is the very first letter: camelCase starts with a lowercase letter (e.g. 'userProfileSettings'), making it ideal for variables and function names, whereas PascalCase starts with an uppercase letter (e.g. 'UserProfileSettings'), conventionally reserved for classes, types, interfaces, and components.
Why do URLs and CSS classes use kebab-case instead of snake_case? ▼
Historically, web search engines (such as Google) treat hyphens in URLs as natural word separators, whereas underscores were historically treated as letter joins. Additionally, CSS identifiers standardly use hyphens ('font-size', 'background-color') for readability and consistency with standard web specifications.
How should acronyms be formatted in camelCase (e.g., HTML, API, ID)? ▼
Leading style guides recommend treating multi-letter acronyms like ordinary words in camelCase to preserve identifier boundaries (e.g. 'parseXmlDocument' or 'getHtmlParser' rather than 'parseXMLDocument' or 'getHTMLParser'). However, if an acronym begins an identifier, it should be entirely lowercase ('xmlHttpRequest', 'userId').
What are Train-Case and Ada_Case? ▼
Train-Case (also known as HTTP-Header-Case) capitalizes the first letter of each word and separates them with hyphens ('Content-Type', 'Accept-Encoding'). Ada_Case capitalizes each word separated by underscores ('User_Account_Number'), common in the Ada programming language and specific enterprise SQL database schemas.
Does Title Case capitalize prepositions and conjunctions? ▼
Under formal publishing style guides (Chicago Manual of Style and AP Stylebook), Title Case capitalizes the first and last words, plus all nouns, verbs, adjectives, and adverbs. Minor grammatical words—including articles ('a', 'an', 'the'), short conjunctions ('and', 'but', 'for'), and prepositions with fewer than four letters ('in', 'on', 'at', 'to')—remain lowercase unless they are the first or last word of the title.