String Case Conventions Explained: camelCase, PascalCase, snake_case, kebab-case, and Title Case Guide

Sep 20, 2026·
toolbox-editorial-team
· 6 min read
blog

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 expecting userId.
  • 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 NameDelimiter PatternExample OutputPrimary Use Cases
camelCaseLowercase first word, uppercase following wordsuserProfileSettingsJavaScript, TypeScript, Java, C# variables & methods
PascalCaseCapitalize every word, no spacesUserProfileSettingsClasses, TypeScript types, React components, C# structs
snake_caseLowercase words joined by underscoresuser_profile_settingsPython (PEP 8), Rust, Ruby, PostgreSQL/MySQL columns
CONSTANT_CASEUppercase words joined by underscoresUSER_PROFILE_SETTINGSGlobal constants, environment variables, Redux actions
kebab-caseLowercase words joined by hyphensuser-profile-settingsURL slugs, CSS class names, HTML attributes, npm packages
SCREAMING-KEBAB-CASEUppercase words joined by hyphensUSER-PROFILE-SETTINGSLisp dialects, command-line arguments, Makefile variables
Train-CaseCapitalized words joined by hyphensUser-Profile-SettingsHTTP headers (Content-Type, X-Forwarded-For)
Ada_CaseCapitalized words joined by underscoresUser_Profile_SettingsAda programming, VHDL, legacy enterprise SQL schemas
dot.caseLowercase words joined by periodsuser.profile.settingsProperty accessor paths, Java package names, config keys
path/caseLowercase words joined by forward slashesuser/profile/settingsREST API routes, Unix file paths, URL endpoints
windows\path\caseLowercase words joined by backslashesuser\profile\settingsWindows filesystem paths, UNC resource naming
flatcaseAll lowercase words concatenated with no delimiteruserprofilesettingsPackage names, Go package directories, URL subdomains
UPPERFLATCASEAll uppercase words concatenated with no delimiterUSERPROFILESETTINGSHardware register labels, assembly mnemonics

2. Editorial & Document Formats

FormatCapitalization RuleExample OutputApplication
Title CaseCapitalize major words; lowercase articles & prepositionsUser Profile SettingsHeadlines, book titles, UI navigation menus
Capitalized CaseCapitalize the first letter of every word indiscriminatelyUser Profile SettingsTable headers, formal certificates, contact forms
Sentence caseCapitalize only the first letter of the first wordUser profile settingsStandard prose, body copy, alert messages
UPPERCASEAll characters capitalizedUSER PROFILE SETTINGSWarnings, acronyms, high-priority visual badges
lowercaseAll characters lowercaseuser profile settingsText normalization, search indexing, email addresses

3. Stylistic & Novelty Cases

FormatPatternExample OutputApplication
alternating caseAlternates lower and upper letters (aLtErNaTiNg)uSeR PrOfIlE SeTtInGsMocking SpongeBob meme, casual communication
inverse caseInverts existing casing (upper becomes lower, lower becomes upper)uSER pROFILE sETTINGSCaps Lock accidental inversion recovery
random caseRandomly toggles character casinguSeR pROfILe SeTTinGsFuzz testing, captcha verification routines

Advertisement Sponsored

Language Standards Matrix: Who Uses What?

Different programming ecosystems enforce strict casing rules in their official style guides:

EcosystemVariables & FunctionsClasses & TypesConstantsDatabase ColumnsURLs & Files
JavaScript / TypeScriptcamelCasePascalCaseCONSTANT_CASEsnake_case (DB)kebab-case.ts
Python (PEP 8)snake_casePascalCaseCONSTANT_CASEsnake_casesnake_case.py
Rustsnake_casePascalCaseCONSTANT_CASEsnake_casesnake_case.rs
Go (Golang)mixedCaps / camelCaseExportedPascalCONSTANT_CASEsnake_caselowercase.go
C# / .NETcamelCase (local/private)PascalCasePascalCasesnake_case / PascalCasePascalCase.cs
SQL (ANSI / Postgres)snake_casesnake_caseCONSTANT_CASEsnake_casesnake_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:

  1. Open the Toolbox Case Converter.
  2. Switch to Batch Multi-Line List mode.
  3. Paste your raw database columns or variable names (one per line).
  4. Select the target casing format (e.g. camelCase for TypeScript or snake_case for Python).
  5. Enable Trim whitespace and Skip empty lines.
  6. Export the result as .txt, a JSON key-value mapping file ({ "original_key": "convertedKey" }), or a CSV spreadsheet.

Interactive Workbench LIVE

String Case Conventions Explained: camelCase, PascalCase, snake_case, kebab-case, and Title Case Guide

Try converting any variable, phrase, or multi-line list across all 21 case formats in real time.
Initializing Workbench...
100% Client-Side RAM Sandbox
🔒 Private Execution: Zero server uploads.
FAQ

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.