Reference Guide
Complete Guide to Text Case Conventions: camelCase, snake_case, kebab-case & More
Every naming convention developers and writers need to know — with real examples, language-specific rules, and when to use each one.
12 min read
Why Case Conventions Matter
Case conventions are standardized rules for formatting multi-word identifiers in code, file names, URLs, and text. Using the correct convention improves readability, ensures consistency, and follows community standards in programming, writing, and documentation.
Whether you're writing Python functions, naming URL slugs, or formatting blog titles, the case convention you choose sends signals to your readers. A well-cased identifier is self-documenting: it tells other developers what kind of thing they're looking at before they read a single line of documentation.
Case conventions matter everywhere text is structured:
- Programming: Variables, functions, classes, constants, modules
- File naming: Scripts, configs, assets, documentation files
- URLs: Page slugs, API endpoints, query parameters
- Documentation: Heading styles, section titles, API docs
- Social media: Hashtags, handles, campaign URLs
The human brain processes consistently-cased text faster. A 2010 study by Binkley et al. found that developers recognized words in identifiers 13.5% faster when snake_case was used, and eye-tracking showed fewer fixations. Consistent casing isn't just about aesthetics — it reduces cognitive load and helps your team move faster through unfamiliar codebases. For quick conversions between formats, a case converter tool can save you from manually retyping dozens of identifiers.
All Major Case Conventions Explained (With Examples)
Here's every major case convention you'll encounter in software development and technical writing. Each entry includes the convention name, an example using the same source phrase, where it's commonly used, and relevant notes.
| Convention | Example | Used In | Notes |
|---|---|---|---|
| UPPERCASE | HELLO WORLD | Emphasis, acronyms | Rarely used for identifiers alone |
| lowercase | hello world | Simple identifiers, tags | Default for most text processing |
| Title Case | Hello World | Headlines, book titles | Articles/prepositions lowercase in AP/Chicago |
| Sentence case | Hello world | Body text, UI labels | Modern design standard |
| camelCase | helloWorld | JS variables, Java methods | Also called "lower camel case" |
| PascalCase | HelloWorld | Classes, React components | Also called "upper camel case" |
| snake_case | hello_world | Python, Ruby, Rust | Also "pothole case" historically |
| kebab-case | hello-world | URLs, CSS, CLI flags | Also "spinal case" or "lisp case" |
| SCREAMING_SNAKE | HELLO_WORLD | Constants, env variables | Also "MACRO_CASE" or "upper snake" |
| dot.case | hello.world | Java packages, config keys | Used in i18n, Spring properties |
| Train-Case | Hello-World | HTTP headers, RFCs | Also called "http-header-case" |
Visual: One Phrase, Every Convention
Source: "my awesome blog post"
UPPERCASE: MY AWESOME BLOG POST
lowercase: my awesome blog post
Title Case: My Awesome Blog Post
Sentence case: My awesome blog post
camelCase: myAwesomeBlogPost
PascalCase: MyAwesomeBlogPost
snake_case: my_awesome_blog_post
kebab-case: my-awesome-blog-post
SCREAMING_SNAKE: MY_AWESOME_BLOG_POST
dot.case: my.awesome.blog.post
Train-Case: My-Awesome-Blog-Post
Case Conventions in Programming Languages
Every language community has established conventions. Following them isn't optional — linters, style guides, and code reviewers will flag deviations. Here's a breakdown by language:
Python (PEP 8)
# Variables and functions: snake_case
user_name = "alice"
max_retry_count = 3
def calculate_total(item_list):
return sum(item.price for item in item_list)
# Classes: PascalCase
class UserProfile:
def __init__(self, name):
self.name = name
# Constants: SCREAMING_SNAKE_CASE
MAX_CONNECTIONS = 100
DEFAULT_TIMEOUT = 30
JavaScript / TypeScript
// Variables and functions: camelCase
const userName = "alice";
let retryCount = 0;
function calculateTotal(itemList) {
return itemList.reduce((sum, item) => sum + item.price, 0);
}
// Classes and React components: PascalCase
class UserAccount {
constructor(name) { this.name = name; }
}
// React component (must be PascalCase)
function UserProfilePage({ userId }) { ... }
// Constants: SCREAMING_SNAKE_CASE
const API_BASE_URL = "https://api.example.com";
const MAX_RETRIES = 5;
Java
// Variables and methods: camelCase
String userName = "alice";
int maxRetryCount = 3;
// Classes and interfaces: PascalCase
public class UserProfile { ... }
public interface Callable { ... }
// Packages: dot.case (all lowercase)
package com.example.userprofile;
// Constants: SCREAMING_SNAKE_CASE
public static final int MAX_CONNECTIONS = 100;
C#
// Local variables and parameters: camelCase
string userName = "alice";
int retryCount = 0;
// Public members, methods, classes: PascalCase
public class UserProfile
{
public string UserName { get; set; }
public int CalculateScore(int baseScore) { ... }
}
// Private fields: _camelCase (underscore prefix)
private string _internalCache;
Rust
// Functions and variables: snake_case
fn calculate_total(items: &[Item]) -> u64 { ... }
let user_name = "alice";
// Types (structs, enums, traits): PascalCase
struct UserProfile { name: String }
enum StatusCode { Ok, NotFound }
trait Serializable { ... }
// Constants and statics: SCREAMING_SNAKE_CASE
const MAX_BUFFER_SIZE: usize = 4096;
// Crate names: kebab-case (in Cargo.toml)
// crate-name = "0.1.0"
Go
// Unexported (private): camelCase
func calculateTotal(items []Item) int { ... }
var internalCache map[string]string
// Exported (public): PascalCase — this IS the access modifier
func NewUserProfile(name string) *UserProfile { ... }
type UserProfile struct { Name string }
// Interfaces: PascalCase, often -er suffix
type Reader interface { Read(p []byte) (n int, err error) }
Ruby
# Variables, methods, symbols: snake_case
user_name = "alice"
def calculate_total(items) ... end
:some_symbol
# Classes and modules: PascalCase
class UserProfile; end
module Authentication; end
# Constants: SCREAMING_SNAKE_CASE (or PascalCase)
MAX_RETRIES = 5
DEFAULT_HOST = "localhost"
# Gems: kebab-case
# gem 'my-awesome-gem'
PHP (PSR standards)
// Variables: camelCase or $snake_case (style-dependent)
$userName = "alice";
// Class methods: camelCase (PSR-1)
class UserProfile {
public function getFullName(): string { ... }
public function calculateAge(): int { ... }
}
// Classes: PascalCase (PSR-1)
class UserService { ... }
// Global functions: snake_case (common convention)
function validate_email($email) { ... }
// Constants: SCREAMING_SNAKE_CASE
const MAX_UPLOAD_SIZE = 10485760;
SQL
-- Keywords: UPPERCASE (widely preferred)
SELECT user_name, email_address
FROM user_profiles
WHERE created_at >= '2026-01-01'
ORDER BY user_name ASC;
-- Table and column names: snake_case
CREATE TABLE blog_posts (
id SERIAL PRIMARY KEY,
post_title VARCHAR(255),
created_at TIMESTAMP
);
CSS / HTML
/* CSS properties: kebab-case */
.hero-section {
background-color: #070712;
border-radius: 1.5rem;
font-size: 1rem;
}
/* HTML attributes: kebab-case */
<div data-user-id="123" aria-label="Navigation">
/* BEM methodology: kebab-case with __ and -- */
.nav-bar { }
.nav-bar__item { }
.nav-bar__item--active { }
When you're working across multiple languages (e.g., a Python backend with a JavaScript frontend), you'll need to convert between conventions frequently. The Prescosoft Text Tools case converter handles all these transformations instantly, letting you convert entire blocks of identifiers at once. For developers working with complex data formats, understanding these conventions pairs well with our guide on common JSON syntax errors — where inconsistent key casing is a frequent source of bugs.
Case Conventions in Non-Programming Contexts
Case conventions extend far beyond code. Writers, designers, SEOs, and marketers rely on them daily — and getting them wrong can hurt discoverability, readability, and professionalism.
URLs: Always kebab-case
Search engines treat hyphens as word separators but underscores as connectors. Google explicitly recommends hyphens. URLs in kebab-case are also easier to read when shared on social media or in emails.
✓ /blog/complete-guide-to-text-case-conventions
✗ /blog/completeGuideToTextCaseConventions
✗ /blog/Complete_Guide_To_Text_Case_Conventions
File Names: kebab-case preferred
File names with kebab-case work consistently across Windows, macOS, and Linux. Spaces cause issues in terminal commands, camelCase creates confusion about casing on case-insensitive file systems (macOS default), and underscores are harder to read in URLs when files get linked.
✓ case-conversion-guide.md
✓ api-reference-v2.json
✗ Case Conversion Guide.md
✗ apiReferenceV2.json
Blog Title & Heading Styles
Blog post titles typically use Title Case, following either AP Style or Chicago Manual of Style rules. The difference: AP lowercases words with fewer than four letters; Chicago lowercases all articles, prepositions, and coordinating conjunctions regardless of length.
# Title Case (AP style)
"A Complete Guide to Text Case Conventions"
# Title Case (Chicago style)
"A Complete Guide to Text Case Conventions"
# Sentence case (modern blogs, Medium, Substack)
"A complete guide to text case conventions"
UI Labels: Sentence vs. Title Case
Modern design systems (Material Design, Apple HIG, Shopify Polaris) favor sentence case for UI labels, buttons, and form fields. It's faster to scan and feels more conversational. Title Case is reserved for proper nouns within labels.
✓ "Create new account" (sentence — modern)
~ "Create New Account" (title — traditional)
✓ "Upload to Google Drive" (sentence + proper noun)
Email Subject Lines
Email marketing data shows sentence case subject lines get slightly higher open rates (they feel less "salesy"). Title Case is still common in transactional emails and formal communications. The key rule: be consistent within your brand voice.
Social Media & Hashtags
Hashtags use PascalCase for accessibility (screen readers parse #TextCaseConverter far better than #textcaseconverter). Twitter/X handles are case-insensitive but conventionally lowercase. Campaign URLs should always be kebab-case for tracking UTM parameters.
If you're writing technical documentation or content that mixes code with prose, our guide on advanced GitHub-flavored Markdown covers how to properly format inline code, headings, and tables — all of which interact with case conventions.
Common Case Mistakes (And How to Avoid Them)
Using camelCase or PascalCase in URLs
Search engines don't parse camelCase word boundaries. /myBlogPost is treated as one word, not three. Always use kebab-case (/my-blog-post) for SEO, readability, and consistency with web standards.
Inconsistent casing within the same project
Mixing getUserData and get_user_info in the same codebase creates confusion. Pick one convention per language/context and enforce it with linters (ESLint, pylint, rubocop) and formatters (black, prettier, ruff).
Mixing snake_case and kebab-case in file names
A project with both user_profile.py and user-settings.json introduces inconsistency. Choose one file naming convention per project and document it. Python projects typically use snake_case files; web projects typically use kebab-case.
Forgetting locale-specific capitalization rules
The Turkish "I problem" is notorious: in Turkish, the lowercase of "I" is "ı" (dotless i), not "i" — and the uppercase of "i" is "İ" (dotted I). Naive .toUpperCase() calls break Turkish text. Always specify locale when case-converting user content. Similarly, German "ß" uppercases to "SS" (or "ẞ" in newer standards).
Using PascalCase for variables in Python
Writing UserProfile = fetch_user() in Python makes it look like a class, not a variable. Python developers reading your code will be confused. PEP 8 mandates snake_case (user_profile = fetch_user()) for everything that isn't a class or constant.
Title Case overuse in modern UI
Using Title Case for every UI element ("Edit Your Profile Settings", "Save Changes Now") feels heavy and dated. Modern interfaces use sentence case for most labels, reserving Title Case for product names, proper nouns, and primary navigation headers.
A common workflow that triggers these mistakes is cleaning up data from multiple sources — CSV exports, scraped web content, or user-submitted fields. Our guide on how to clean up messy text data covers systematic approaches to normalizing inconsistent inputs before processing.
How to Convert Between Case Conventions Instantly
When you need to convert text between case formats — whether you're renaming variables, creating URL slugs from titles, or formatting headings — the fastest approach is a dedicated text case converter.
Paste your text
Copy the text you want to convert — variable names, titles, identifiers, or any phrase — and paste it into the Prescosoft Text Tools case converter. Works with single words, multiple lines, or entire lists.
Select your target convention
Choose from UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case, kebab-case, and more. The conversion happens instantly — no button press required.
Copy the result
Click to copy the converted text to your clipboard. Paste directly into your code, document, URL field, or wherever you need it. All processing happens in your browser — nothing is sent to a server.
Handling Edge Cases
Good case converters handle tricky inputs gracefully:
- Numbers: "version2Release" → "version_2_release" (snake_case)
- Hyphens in source: "well-known" → "wellKnown" (camelCase)
- Apostrophes: "don't" is preserved as a single unit
- Unicode: Accented characters convert correctly (café → CAFÉ)
- Mixed input: "getHTTPResponse" → "get_http_response" (recognizes acronyms)
Batch Conversion
When refactoring a codebase or migrating between frameworks, you often need to convert dozens of identifiers at once. The Prescosoft Text Tools case converter handles multi-line input — paste your entire list and convert every line simultaneously:
# Input (paste these lines):
getUserProfile
calculateTotalPrice
sendEmailNotification
# Output (snake_case):
get_user_profile
calculate_total_price
send_email_notification
While IDE plugins (like VS Code's Change Case extension) work for in-editor conversions, an online case converter is faster for one-off tasks — no installation, works in any browser, and handles conversions between formats your IDE doesn't support (like Title Case or Sentence case).
Case Conversion Rules: What Happens Under the Hood
Understanding how case conversion works internally helps you predict edge cases and choose the right tool. Here's what a quality converter does:
1. Word Boundary Detection
The first step is splitting input into individual words. The converter looks for several boundary signals:
// Spaces: "hello world" → ["hello", "world"]
// Underscores: "hello_world" → ["hello", "world"]
// Hyphens: "hello-world" → ["hello", "world"]
// camelCase transitions: "helloWorld" → ["hello", "world"]
// Acronym boundaries: "getHTTPResponse" → ["get", "HTTP", "response"]
The tricky case is acronyms in camelCase. "getHTTPResponse" should split as three words, not "get H T T P Response." Smart converters detect sequences of uppercase letters followed by a lowercase transition.
2. Numbers and Special Characters
Numbers create implicit word boundaries. "my2ndVariable" splits into ["my", "2nd", "variable"]. The converter must decide whether digits attach to the preceding or following word — most implementations treat digit-to-letter transitions as boundaries:
"file2name" → snake_case → "file_2_name"
"version3Release" → kebab-case → "version-3-release"
"user123profile" → camelCase → "user123Profile"
3. Unicode Handling
Non-ASCII characters add complexity. Key edge cases include:
- German ß: Uppercases to "SS" in most contexts ("straße" → "STRASSE")
- Turkish İ/i: Lowercase "I" is "ı" in Turkish, "i" in English
- Greek: Final sigma (ς) vs. medial sigma (σ) when lowercasing
- Ligatures: "fi" (U+FB01) should expand to "fi" for splitting
The Prescosoft case converter tool uses Unicode-aware processing to handle these cases correctly without requiring locale configuration from the user.
4. Title Case Intelligence
Title Case isn't simply "capitalize every word." Standard rules keep certain words lowercase:
- Articles: a, an, the
- Coordinating conjunctions: and, but, or, for, nor
- Short prepositions: in, on, at, to, by, of, up
But the first and last words are always capitalized regardless of their part of speech. A proper title case converter applies these rules automatically.
"the quick brown fox jumps over the lazy dog"
→ "The Quick Brown Fox Jumps over the Lazy Dog"
(articles/prepositions lowercase, first/last word capitalized)
5. Abbreviations and Acronyms
Acronyms like "JSON", "API", and "HTML" should remain uppercase in most conversions. When converting to snake_case, they become "json_api_parser" not "j_s_o_n_a_p_i_parser". Smart converters preserve recognized acronyms as single tokens during word splitting.
Understanding these rules is especially valuable when you're building developer tools or working with structured data. Our guide on advanced GitHub-flavored Markdown demonstrates how proper case conventions integrate with heading IDs and anchor links — another area where case sensitivity causes subtle bugs.
Quick Reference: Case Convention Cheat Sheet
Bookmark this section. It's a compact reference for the most common case conventions, organized by where you'll use them.
Code
Variables: snake_case or camelCase
Classes: PascalCase
Constants: SCREAMING_SNAKE
CSS classes: kebab-case
URLs & Files
URL slugs: kebab-case
File names: kebab-case
API endpoints: kebab-case
UTM params: kebab-case
Writing
Headlines: Title Case
Body text: Sentence case
UI labels: Sentence case
Hashtags: PascalCase
Data & Config
DB columns: snake_case
JSON keys: camelCase or snake_case
Env vars: SCREAMING_SNAKE
Config keys: dot.case
Complete Convention Summary
Convert Any Case Instantly — Free, Private, No Uploads
Paste your text, pick a convention, get the result. The Prescosoft Text Tools case converter handles camelCase, snake_case, kebab-case, PascalCase, Title Case, Sentence case, and more — all processed in your browser with zero data sent to any server.
100% client-side. No account required. Works offline.
Open Case ConverterFrequently Asked Questions
What case should I use for URLs?
Use kebab-case for URLs. It's readable, standard across major websites, and SEO-friendly. Search engines treat hyphens as word separators, so /my-blog-post ranks better than /myBlogPost or /my_blog_post. Google explicitly recommends hyphens over underscores in URLs.
Is camelCase or snake_case better for readability?
Studies (notably Binkley et al., 2010) show snake_case is faster to read — subjects recognized words 13.5% faster in snake_case identifiers. However, camelCase is more compact. In practice, following your language's community convention matters far more than personal preference. Use a camelCase converter to switch between formats when working across languages.
What's the difference between PascalCase and camelCase?
PascalCase capitalizes the first letter of every word including the first one (HelloWorld), while camelCase leaves the first letter lowercase (helloWorld). PascalCase is typically used for classes and types, while camelCase is used for variables and methods. Both belong to the "camel case" family but serve different purposes in code.
Should I use title case or sentence case for headings?
Modern UX design favors sentence case for headings — it's easier to scan and feels more natural to read. Traditional publishing (AP style, Chicago Manual of Style) favors title case for formal headlines. The key is consistency: pick one style for your project and apply it everywhere. Use a title case converter when you need to switch formats quickly.
How do you handle numbers in case conversions?
Numbers typically break word boundaries during conversion. For example, "my2ndVariable" becomes "my_2nd_variable" in snake_case and "my-2nd-variable" in kebab-case. Good case converters treat digit-to-letter transitions as word boundaries, similar to how camelCase uppercase transitions work. This ensures "version3Release" correctly becomes "version_3_release" rather than "version3_release".
Why does my Python linter complain about camelCase?
PEP 8 — Python's official style guide — mandates snake_case for function and variable names. Linters like pylint and flake8 flag camelCase as a naming convention violation because it breaks Python community standards. Use auto-formatters like black or ruff to enforce snake_case automatically, and use a case converter online to quickly transform camelCase identifiers from other languages into Python-compliant snake_case.
Related Guides
How to Clean Up Messy Text Data
Systematic approaches to normalizing inconsistent text from multiple sources — including case normalization, whitespace cleanup, and encoding fixes.
Common JSON Syntax Errors and How to Fix Them
The 6 most common JSON errors developers encounter — including inconsistent key naming that relates directly to case convention choices.
Advanced GitHub-Flavored Markdown
How heading formats, anchor IDs, and table syntax interact with case conventions in technical documentation.
Why Client-Side JSON Tools Are Safer
Why processing sensitive data in your browser (like the Prescosoft text toolkit does) matters for privacy and security.