The Complete Text Case Reference
Every text case format has a specific purpose, history, and set of rules. Here's the definitive reference: Programming Cases: • camelCase: First word lowercase, subsequent words capitalized. No separators. Example: firstName, getUserProfile, isValidEmail Used in: JavaScript/TypeScript variables and functions, Java methods, JSON property names Origin: The capital letters in the middle resemble a camel's humps. • PascalCase (Upper CamelCase): Every word capitalized, no separators. Example: UserProfile, HttpResponse, ReactComponent Used in: Class names (Java, C#, TypeScript), React components, TypeScript interfaces/types Origin: Named after the Pascal programming language, which popularized the convention. • snake_case: All lowercase, words separated by underscores. Example: user_profile, get_user_by_id, is_valid Used in: Python variables and functions, Ruby, database column names, file names Origin: The underscores look like a snake crawling on the ground. • SCREAMING_SNAKE_CASE (CONSTANT_CASE): All uppercase, underscores. Example: MAX_RETRIES, API_BASE_URL, DATABASE_HOST Used in: Constants in most languages, environment variables, configuration keys. • kebab-case: All lowercase, words separated by hyphens. Example: user-profile, main-content, bg-primary Used in: CSS class names, URL slugs, HTML attributes, CLI flags, npm package names. Origin: The words look like they're skewered on a kebab. • dot.case: All lowercase, words separated by dots. Example: user.profile.name, app.config.database Used in: Java package names, configuration file keys (YAML/TOML), property chains. Writing Cases: • Title Case: Capitalize the first letter of each major word. Example: 'The Complete Guide to Web Development' Rules: Capitalize nouns, verbs, adjectives, adverbs. Don't capitalize articles (a, an, the), prepositions (in, on, at, for), or conjunctions (and, but, or) unless they're the first word. • Sentence case: Capitalize only the first word and proper nouns. Example: 'The complete guide to web development' Used in: Body text, UI labels (Apple/Google guidelines), subheadings in many style guides.
Programming Naming Conventions by Language
Every major programming language has established naming conventions. Following them makes your code immediately readable to other developers: JavaScript / TypeScript: • Variables: camelCase (let userName, const isActive) • Functions: camelCase (function getUserById()) • Classes: PascalCase (class UserService) • Constants: SCREAMING_SNAKE_CASE (const API_URL) • Interfaces/Types: PascalCase (interface UserProfile, type ResponseData) • React Components: PascalCase (function NavigationBar()) • Custom Hooks: camelCase with 'use' prefix (function useAuth()) • File names: kebab-case (user-profile.tsx) or PascalCase (UserProfile.tsx) depending on team convention • CSS modules: kebab-case (.container-wrapper) Python: • Variables: snake_case (user_name, is_active) • Functions: snake_case (def get_user_by_id():) • Classes: PascalCase (class UserService:) • Constants: SCREAMING_SNAKE_CASE (MAX_RETRIES = 3) • Modules: snake_case (user_service.py) • Private: Leading underscore (_internal_method) • Name mangling: Double underscore (__private_attr) Reference: PEP 8 — Style Guide for Python Code Java / Kotlin: • Variables: camelCase • Methods: camelCase • Classes: PascalCase • Constants: SCREAMING_SNAKE_CASE • Packages: lowercase dot.case (com.example.userservice) Rust: • Variables/functions: snake_case • Types/traits: PascalCase • Constants: SCREAMING_SNAKE_CASE • Crates/modules: snake_case CSS: • Class names: kebab-case (.main-container, .btn-primary) • BEM methodology: block__element--modifier (.card__title--highlighted) • CSS custom properties: kebab-case (--color-primary, --font-size-lg) • Sass/Less variables: kebab-case or with $ prefix ($primary-color) SQL / Databases: • Table names: snake_case, plural (users, order_items) • Column names: snake_case (first_name, created_at) • These become JSON or ORM property names, often requiring case conversion.
URL Slugs, SEO, and Text Case
Text case conventions have a direct, measurable impact on SEO and URL readability: URL Slugs — The SEO Impact: Google's official guidance recommends using hyphens in URLs. Their documentation states: 'We recommend that you use hyphens (-) instead of underscores (_) in your URLs.' Why hyphens win: • Google treats hyphens as word separators: 'web-development' = two words (web, development) • Google treats underscores as word joiners: 'web_development' = one word (web_development) • This directly affects search matching. If someone searches 'web development', the hyphenated URL has an advantage. URL Best Practices: • Always use kebab-case (lowercase with hyphens) • Keep URLs under 60 characters when possible • Include target keywords naturally • Remove stop words (a, the, and, in) unless they change meaning • Never use spaces (encoded as %20), uppercase, or special characters Examples: ✅ /articles/css-gradient-guide ❌ /articles/CSS_Gradient_Guide ❌ /articles/css%20gradient%20guide ❌ /articles/CSSGradientGuide SEO Title Tags: For title tags, the debate is Title Case vs. Sentence case: • Title Case: 'How to Build a Responsive Website in 2026' Pros: More attention-grabbing, traditional for headlines Cons: Can look 'clickbaity' in search results CTR Impact: Studies show 2-5% higher CTR for Title Case in competitive niches • Sentence case: 'How to build a responsive website in 2026' Pros: More natural, preferred by Google's own documentation Cons: Less visually prominent in search results Used by: Apple, Google, Medium, Intercom Meta Descriptions: Always use Sentence case for meta descriptions. They should read as natural sentences, not headlines. Breadcrumbs and Navigation: Use Title Case for primary navigation items and Sentence case for breadcrumbs. This hierarchy communicates information importance visually.
Automated Case Conversion: Tools and Libraries
Manual case conversion is tedious and error-prone, especially with edge cases. Modern tools and libraries handle the complexity: JavaScript Libraries: • change-case (npm): The most comprehensive case conversion library import { camelCase, snakeCase, kebabCase } from 'change-case'; camelCase('hello world'); // 'helloWorld' snakeCase('helloWorld'); // 'hello_world' • lodash: Popular utility library with case conversion functions _.camelCase('hello world'); // 'helloWorld' _.kebabCase('Hello World'); // 'hello-world' _.snakeCase('helloWorld'); // 'hello_world' CSS text-transform Property: CSS can change text display case without modifying the actual content: .uppercase { text-transform: uppercase; } /* HELLO WORLD */ .lowercase { text-transform: lowercase; } /* hello world */ .capitalize { text-transform: capitalize; } /* Hello World */ .full-width { text-transform: full-width; } /* Hello */ Important: text-transform only changes visual presentation. The underlying text in the DOM remains unchanged. For form submissions and JavaScript processing, the original case is preserved. Use JavaScript for actual data transformation. Editor Extensions: • VS Code: Built-in 'Transform to Uppercase/Lowercase/Title Case' commands (Ctrl+Shift+P) • JetBrains IDEs: Toggle Case with Ctrl+Shift+U • Vim: ~ for toggle, gU for uppercase, gu for lowercase Edge Cases in Case Conversion: Case conversion isn't as simple as it seems. Tricky scenarios include: • Acronyms: 'XMLParser' → snake_case should be 'xml_parser', not 'x_m_l_parser' • Numbers: 'color3D' → kebab-case could be 'color-3-d' or 'color-3d' • Unicode: Turkish 'I' lowercases to 'ı' (dotless i), not 'i'. German 'ß' uppercases to 'SS'. • Apostrophes: "it's a test" → Title Case = "It's a Test" or "It's A Test"? Professional libraries handle these edge cases correctly. Our Text Case Converter handles all 12 format conversions with proper edge case handling.
Style Guides and Team Conventions
Consistency in text case is a team discipline, not just a personal preference. Style guides codify conventions so everyone follows the same rules: Major Tech Company Conventions: • Apple (Human Interface Guidelines): Sentence case for all UI elements (buttons, labels, menu items). Example: 'Sign in', not 'Sign In'. • Google (Material Design): Sentence case for buttons and tabs, Title Case for app bar titles. Example: Button reads 'Create account', app bar reads 'Settings'. • Microsoft (Fluent Design): Sentence case for most UI text, Title Case for proper nouns and product names only. The Industry Trend: The clear trend among major tech companies is toward Sentence case for UI elements. It feels more conversational, more accessible, and less 'shouty' than Title Case. Creating Your Team's Convention: Document these decisions in your project's CONTRIBUTING.md or style guide: 1. Code naming: Which case for variables, functions, classes, constants, and files? 2. UI text: Sentence case or Title Case for buttons, headings, labels? 3. URLs: Confirm kebab-case for all routes and slugs 4. Database: snake_case for all table and column names 5. API: camelCase for JSON properties? Or snake_case? 6. CSS: Class naming convention (BEM, OOCSS, utility-first)? Enforcing Conventions Automatically: • ESLint: camelCase rule for JavaScript variables (no-underscore-dangle) • Pylint: snake_case enforcement for Python • Prettier: While not a case converter, consistent formatting reduces debates • commitlint: Enforce commit message casing (conventional commits use lowercase) • Naming convention linters: @typescript-eslint/naming-convention for granular TypeScript rules The key insight: the specific convention matters less than consistency. A team that consistently uses one style produces more readable code than a team where each developer uses their preferred style. Remember: Naming conventions are about communication. The goal isn't to follow rules for their own sake — it's to make your code, content, and URLs immediately understandable to anyone who reads them.
Sources & Further Reading
Convert Text Cases Instantly
Our Text Case Converter transforms text between 12 formats in real-time — camelCase, snake_case, kebab-case, Title Case, and more. One-click copy, 100% free.
Try Case Converter