Skip to main content
ToolNest AI
Text Tools9 min read

Case Converter: UPPERCASE, camelCase, snake_case & More — Free Tool

Learn every text case format — UPPERCASE, Title Case, camelCase, snake_case, kebab-case, and more — when to use each for writing and code, and the real rules behind proper Title Case. Free, instant tool.

ToolNest AI Team

Author

Published

Case Converter — convert text between UPPERCASE, lowercase, Title Case, camelCase, snake_case, kebab-case and more, free online tool

Every programming language, style guide, and URL system has its own convention for capitalizing text — and switching between them by hand is tedious and error-prone. This guide covers every common case format, when each one is actually used in practice, and a detail that trips up even careful writers: proper Title Case is not simply "capitalize every word."

Convert any text instantly between all these formats with the ToolNest AI Case Converter.


The 10 Case Formats

10 case format examples side by side — UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, alternating case, inverse case

FormatExampleTypical use
UPPERCASETHE QUICK BROWN FOXEmphasis, headers, acronyms
lowercasethe quick brown foxNormalizing input, comparisons
Title CaseThe Quick Brown FoxHeadlines, article & book titles
Sentence caseThe quick brown foxStandard prose formatting
camelCasetheQuickBrownFoxJavaScript/Java variable & function names
PascalCaseTheQuickBrownFoxClass names, React components
snake_casethe_quick_brown_foxPython variables, database columns
kebab-casethe-quick-brown-foxURL slugs, CSS classes, HTML attributes
CONSTANT_CASETHE_QUICK_BROWN_FOXEnvironment variables, constants
aLtErNaTiNg cAsE / InVeRsE cAsEtHe qUiCk...Novelty/meme text formatting

Naming Conventions by Programming Language

Naming conventions table by language — JavaScript/Java camelCase, Python/Ruby snake_case, CSS/HTML kebab-case, with variable/function/class/constant columns

Each programming language ecosystem has settled on its own dominant convention, and following it matters — mixing conventions within a single codebase triggers linter warnings and makes code harder to read.

JavaScript, Java, C#: variables and functions use camelCase (e.g. getUserName); classes and types use PascalCase (e.g. class UserProfile); constants use CONSTANT_CASE (e.g. MAX_RETRY_COUNT).

Python, Ruby: variables and functions use snake_case (e.g. get_user_name); classes still use PascalCase (e.g. class UserProfile); constants use CONSTANT_CASE.

CSS, HTML, URLs: class names, HTML attributes, and URL slugs all conventionally use kebab-case (e.g. .user-profile-card, /blog/my-article-title) because hyphens are readable, SEO-friendly, and don't conflict with CSS or URL syntax the way underscores or camelCase can.

This is why the ToolNest AI Case Converter supports all of these formats directly — converting a phrase like "user profile settings" into the correct format for whatever context you're working in (a Python variable, a CSS class, a URL slug) takes one click instead of manual retyping.


Title Case Has Real Rules

Title Case rules — naive capitalize-every-word is wrong, correct version keeps minor words like "of" and "the" lowercase, with style guide comparison

A common misconception is that "Title Case" simply means capitalizing the first letter of every word. It doesn't. Professional style guides (AP, Chicago, MLA) define specific rules about which words stay lowercase:

Words that stay lowercase (unless they're the first or last word of the title):

  • Articles: a, an, the
  • Coordinating conjunctions: and, but, or, nor, for, so, yet
  • Short prepositions (style-guide dependent, typically 4 letters or fewer): in, on, at, to, of, by, up, off

The first and last word are always capitalized, regardless of what word they are.

Example — naive vs correct:

✗ "The Lord Of The Rings"   (capitalizes every word — incorrect)
✓ "The Lord of the Rings"   (proper Title Case — "of" and second "the" stay lowercase)

Style guides don't fully agree on the details: AP Style capitalizes prepositions with four or more letters (like "With" or "From"), while Chicago and MLA style lowercase all prepositions regardless of length. Most general-purpose Title Case tools implement a reasonable approximation of these rules — worth double-checking manually for formal publishing where exact style-guide compliance matters.


How to Use the Case Converter

The ToolNest AI Case Converter runs entirely in your browser and converts instantly as you type.

  1. Paste or type your text into the input field
  2. View all conversions simultaneously — every supported case format updates live
  3. Click "Copy" next to the format you need to copy it directly to your clipboard
  4. Use "Clear All" to start over with new text

No character limit, no account needed, and nothing is sent to a server — the conversion logic runs entirely client-side in JavaScript.


Case Conversion in Different Languages

JavaScript:

"hello world".toUpperCase();  // "HELLO WORLD"
"HELLO WORLD".toLowerCase();  // "hello world"
 
// camelCase
const toCamelCase = (str) =>
  str.replace(/[-_\s]+(.)?/g, (_, c) => c ? c.toUpperCase() : '')
     .replace(/^(.)/, (m) => m.toLowerCase());
 
// snake_case
const toSnakeCase = (str) =>
  str.replace(/([a-z])([A-Z])/g, '$1_$2').replace(/[\s-]+/g, '_').toLowerCase();
 
// kebab-case
const toKebabCase = (str) =>
  str.replace(/([a-z])([A-Z])/g, '$1-$2').replace(/[\s_]+/g, '-').toLowerCase();

Python:

"hello world".upper()   # "HELLO WORLD"
"HELLO WORLD".lower()   # "hello world"
"hello world".title()   # "Hello World" (naive — capitalizes every word)
 
import re
def to_snake_case(s):
    s = re.sub(r'([a-z])([A-Z])', r'\1_\2', s)
    return re.sub(r'[\s-]+', '_', s).lower()

PHP:

strtoupper("hello world");   // "HELLO WORLD"
strtolower("HELLO WORLD");   // "hello world"
ucwords("hello world");       // "Hello World"

Common Mistakes

Mistake 1: Mixing naming conventions within a codebase. Using snake_case variables in a JavaScript file (where camelCase is standard) breaks style consistency, often triggers linter warnings, and makes the code harder for other developers to scan. Pick the dominant convention for your language and stick to it throughout the project.

Mistake 2: Using spaces or uppercase letters in URL slugs. URLs are case-sensitive on most servers, and spaces must be percent-encoded (%20) if left in a URL, which is both ugly and technically fragile. Always convert page titles to lowercase kebab-case for URL slugs — see also the ToolNest AI Slug Generator for automated, SEO-friendly slug creation.

Mistake 3: Treating "Title Case" as "capitalize every word." As covered above, this produces titles that don't match professional style-guide conventions — minor words like "of," "the," and "and" should stay lowercase in the middle of a title.

Mistake 4: Forgetting that JSON keys are case-sensitive. {"userName": "..."} and {"username": "..."} are different keys entirely. When converting between naming conventions for API payloads, make sure both the producer and consumer of the data agree on the exact casing used.

Mistake 5: Applying camelCase conversion to acronyms incorrectly. Converting "HTTP Server URL" to camelCase naively can produce awkward results like hTTPServerURL. Most robust camelCase converters have special handling to treat consecutive capital letters as a single acronym unit (httpServerUrl), but always double-check the result against your team's actual style guide.


Frequently Asked Questions

What is the difference between camelCase and PascalCase?

Both formats concatenate words without spaces or separators, capitalizing the first letter of each word after the first. The difference is the very first letter: camelCase starts with a lowercase letter (theQuickFox), while PascalCase starts with an uppercase letter (TheQuickFox). In most languages, camelCase is used for variables and functions, while PascalCase is used for classes, types, and components.

Is Title Case just capitalizing every word?

No. Proper Title Case, as defined by style guides like AP and Chicago, keeps certain "minor words" lowercase in the middle of a title — articles (a, an, the), coordinating conjunctions (and, but, or), and short prepositions (of, in, to). Only the first and last word of the title, plus all major words, are capitalized. "The Lord of the Rings" is correct Title Case; "The Lord Of The Rings" is not.

When should I use snake_case vs kebab-case?

snake_case (the_quick_fox) is the standard convention for variable and function names in Python and Ruby, and is also common for database column names. kebab-case (the-quick-fox) is used for URL slugs, CSS class names, and HTML attributes — contexts where hyphens are syntactically safe and where underscores can sometimes be visually confused with spaces, especially in URLs where they're less commonly used than hyphens.

Why do URLs use kebab-case instead of camelCase or snake_case?

URLs are conventionally lowercase because URLs can technically be case-sensitive depending on server configuration, and mixing cases invites broken links from typos or copy-paste errors. Hyphens are preferred over underscores because search engines historically treated hyphens as word separators (improving SEO for multi-word slugs) while underscores were sometimes treated as joining words together into a single token.

What is CONSTANT_CASE used for?

CONSTANT_CASE (also called SCREAMING_SNAKE_CASE), written as ALL_CAPS_WITH_UNDERSCORES, is the near-universal convention for naming constants and environment variables across most programming languages — for example, MAX_RETRY_COUNT or DATABASE_URL. The all-caps styling visually signals to other developers that the value is fixed and should not be reassigned.

Can I convert text back to its original case after converting it?

Not automatically, and this is an important limitation to understand: case conversions like lowercase, uppercase, and snake_case are lossy — once you convert "The Quick Fox" to lowercase, the information about which letters were originally capitalized is gone. To preserve the ability to revert, keep your original text somewhere before converting, or use the ToolNest Case Converter's live side-by-side view, which always keeps your original input visible alongside the converted output.

Does converting case affect special characters or numbers?

Case conversion functions typically only affect alphabetic characters — numbers, punctuation, and symbols pass through unchanged. For example, converting "Item #42 (Special!)" to uppercase produces "ITEM #42 (SPECIAL!)" — the #, 42, (, and ! are untouched, since case doesn't apply to them.

How is Sentence case different from Title Case?

Sentence case capitalizes only the first letter of the entire string (and typically the first letter after any sentence-ending punctuation), leaving every other word lowercase — matching normal prose writing style ("The quick brown fox jumps."). Title Case capitalizes the first letter of most words individually, following the minor-word rules described above ("The Quick Brown Fox Jumps").

Share

About the author

ToolNest AI Team

The ToolNest AI team builds free tools that help developers, marketers, and creators do more online — faster.