P
Privatool
Tutorial4 min read

Text Case Converter — UPPERCASE, lowercase, camelCase, snake_case and More

Learn all text case formats — camelCase, PascalCase, snake_case, kebab-case, Title Case and more — when to use each, and how to convert between them instantly.

By Privatool Team·

Text case refers to the capitalization pattern applied to text. Different contexts — programming languages, style guides, URLs, databases — use different conventions. Converting between them manually is tedious and error-prone. Here's a complete reference.

The case formats explained

UPPERCASE

All letters capitalized. Used for acronyms, emphasis, constants in some languages, and headings in certain design styles.

HELLO WORLDHELLO WORLD

lowercase

All letters in lowercase. Used for CSS properties, HTML attributes, email addresses, and URLs.

Hello Worldhello world

Title Case

The first letter of each word is capitalized. Used for book titles, article headlines, product names, and UI headings.

the quick brown foxThe Quick Brown Fox

Title case rules vary by style guide (see below).

Sentence case

Only the first letter of the first word is capitalized, as in a regular sentence. Used for UI labels, error messages, and descriptions.

the quick brown foxThe quick brown fox

camelCase

No spaces; each word after the first starts with a capital letter. Used in JavaScript, Java, and Swift for variable and function names.

hello worldhelloWorld

PascalCase

Like camelCase but the first word is also capitalized. Used for class names, component names (React), and types in most languages.

hello worldHelloWorld

snake_case

Words separated by underscores, all lowercase. Used in Python, Ruby, Rust, and SQL for variable and function names.

hello worldhello_world

SCREAMING_SNAKE_CASE

snake_case but all uppercase. Used for constants in Python, environment variables, and configuration keys.

hello worldHELLO_WORLD

kebab-case

Words separated by hyphens, all lowercase. Used in URLs, CSS class names, HTML attributes, and file names.

hello worldhello-world

dot.case

Words separated by dots, all lowercase. Used in package names (npm, Java), configuration keys, and logging namespaces.

hello worldhello.world

Case conventions by programming language

Language Variables Functions Classes Constants
JavaScript camelCase camelCase PascalCase SCREAMING_SNAKE
Python snake_case snake_case PascalCase SCREAMING_SNAKE
Java camelCase camelCase PascalCase SCREAMING_SNAKE
Go camelCase camelCase PascalCase PascalCase
Rust snake_case snake_case PascalCase SCREAMING_SNAKE
CSS kebab-case
SQL snake_case snake_case UPPERCASE
Ruby snake_case snake_case PascalCase SCREAMING_SNAKE

Title case style guide differences

Different style guides have different rules for which words to capitalize in titles:

Style Capitalize Don't capitalize
AP Style All major words Articles, prepositions under 4 letters, conjunctions
Chicago All major words Articles, coordinating conjunctions, prepositions
APA First word, proper nouns Most other words
MLA All major words Articles, short prepositions, conjunctions

Example: "The Cat in the Hat" (Chicago) vs. "The Cat In the Hat" would differ across guides.

Converting case in JavaScript

If you need to convert case programmatically:

// To camelCase
const toCamel = s => s.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (_, c) => c.toUpperCase())

// To snake_case
const toSnake = s => s.replace(/\s+/g, '_').replace(/([A-Z])/g, '_$1').toLowerCase().replace(/^_/, '')

// To kebab-case
const toKebab = s => s.replace(/\s+/g, '-').replace(/([A-Z])/g, '-$1').toLowerCase().replace(/^-/, '')

// To PascalCase
const toPascal = s => s.replace(/(?:^|\s|_|-)(\w)/g, (_, c) => c.toUpperCase())

These handle simple cases. For production use, consider a library like change-case which handles edge cases (acronyms, numbers, Unicode).

How to convert text case free

  1. Go to Text Case Converter
  2. Paste your text into the input
  3. Click the target case button (UPPERCASE, camelCase, snake_case, etc.)
  4. Copy the converted result

All conversion happens instantly in your browser — no data is sent anywhere.

#text case converter#camelcase#snake case#kebab case#uppercase lowercase

Try our free tools

All tools run in your browser. Files never leave your device.

Explore free tools →