Whether you are a programmer following a project's style guide, a writer formatting headlines, or a data analyst cleaning messy spreadsheets, converting between text cases is a task you encounter constantly. Instead of manually retyping text or writing regex patterns every time, a dedicated text case converter handles the job instantly and accurately.
This guide covers every major text case format, explains when and where each one is used, compares naming conventions across programming languages, and shows you how our free Text Case Converter handles all these transformations in one click.
One of the most common use cases for case conversion is adapting code between languages with different naming conventions. Here is a comprehensive comparison:
| Format | Example | Languages/Contexts | Used For |
|---|---|---|---|
| camelCase | myVariableName | JavaScript, Java, C#, TypeScript, Go | Variables, functions, methods |
| PascalCase | MyVariableName | C#, Java, TypeScript, Pascal, Delphi | Classes, structs, interfaces |
| snake_case | my_variable_name | Python, Ruby, C (libc), Rust, PHP | Variables, functions, DB columns |
| SCREAMING_SNAKE | MY_CONSTANT | C, C++, Python, Ruby, Java (constants) | Constants, macros, env vars |
| kebab-case | my-variable-name | CSS, HTML, URLs, Lisp, Kotlin filenames | CSS classes, URLs, CLI flags |
| Train-Case | My-Variable-Name | Rare in code; some HTTP headers | Headers, some APIs |
| dot.case | my.variable.name | Config files, Java packages | Package names, config keys |
| flatcase | myvariablename | Go packages, some JS libs | Package names, URLs |
| UPPERCASE | MYVARIABLENAME | C macros, Fortran, SQL keywords | Macros, constants, enums |
JavaScript uses camelCase for variables, functions, and object properties, and PascalCase for class declarations and constructor functions. Constants use SCREAMING_SNAKE_CASE. This convention is enforced by popular linters like ESLint with the "camelcase" rule.
// Variables and functions — camelCase
const userProfile = getUserProfile(userId);
function calculateTotal(items) { return items.reduce((sum, i) => sum + i.price, 0); }
// Classes — PascalCase
class ShoppingCart { constructor() { this.items = []; } }
// Constants — SCREAMING_SNAKE_CASE
const MAX_RETRY_ATTEMPTS = 3;
const API_BASE_URL = "https://api.example.com";
Python's PEP 8 style guide mandates snake_case for functions, variables, and module names, and PascalCase for classes. Constants use SCREAMING_SNAKE_CASE. Private variables are prefixed with a single underscore, and name-mangled variables use double underscores.
# Variables and functions — snake_case
user_profile = get_user_profile(user_id)
def calculate_total(items):
return sum(item.price for item in items)
# Classes — PascalCase
class ShoppingCart:
def __init__(self):
self.items = []
# Constants — SCREAMING_SNAKE_CASE
MAX_RETRY_ATTEMPTS = 3
API_BASE_URL = "https://api.example.com"
Rust has strict naming conventions enforced by the compiler itself. Functions and methods use snake_case, types and traits use PascalCase (called UpperCamelCase in Rust docs), and constants use SCREAMING_SNAKE_CASE. Static lifetime parameters use a short lowercase name like 'a.
Go uses camelCase for unexported identifiers and PascalCase for exported ones (capitalization controls visibility). Package names use flatcase (lowercase, no underscores). Constants can use either camelCase or SCREAMING_SNAKE_CASE depending on whether they are exported.
C# uses PascalCase for almost everything: classes, methods, properties, namespaces. Local variables and parameters use camelCase. Constants use PascalCase (unlike most other languages). Private fields may use an underscore prefix with camelCase: _privateField.
Title case capitalizes the first letter of each major word. However, the exact rules differ between style guides:
Example: "the quick brown fox jumps over the lazy dog" becomes "The Quick Brown Fox Jumps over the Lazy Dog" in AP Title Case.
Sentence case capitalizes only the first letter of the first word and proper nouns. Everything else is lowercase. This is the standard for body text in English and is increasingly preferred for headings in modern web design (Material Design, Apple HIG both use sentence case for section headers).
Simple transformations: UPPERCASE converts all characters to capitals (useful for acronyms, emphasis, or data normalization). Lowercase converts everything to small letters (useful for email addresses, URL slugs, or case-insensitive comparisons).
Also known as "SpongeBob case" or "mock case," this alternates between uppercase and lowercase characters. While mostly used humorously on social media, it has legitimate uses in testing character-handling code and creating visual variety in display typography.
Swaps the case of every character: uppercase becomes lowercase and vice versa. Useful for quickly fixing text that was accidentally typed with Caps Lock on.
Here are real-world scenarios where a text case converter saves significant time:
A quality case converter does more than just change letter cases — it understands word boundaries. Our Text Case Converter intelligently detects boundaries created by:
This means you can paste "XMLHttpRequest" and convert it to snake_case as "xml_http_request", to kebab-case as "xml-http-request", or to title case as "Xml Http Request" — all correctly handling the acronym boundaries.