Reference Guide

How To Change Text Case

Learn what text case styles mean, when to use each one, and how developers and writers use case conversion in everyday work.

5 min read Updated Jun 2026

Quick Answer

Text case refers to the capitalization pattern applied to letters in a string. Converting text case means changing that pattern — turning "hello world" into "Hello World", "HELLO_WORLD", or "helloWorld" — without changing the words themselves.

Writers use case styles for readability and consistency. Developers use them because programming languages and systems have strict naming conventions that must be followed exactly for code to work correctly.

Try The Case Converter →

The Main Case Styles

UPPERCASE. Every letter is capitalized: "HELLO WORLD". Used for constants in many programming languages, acronyms, and emphasis. In body text, all-caps is hard to read at length and is often interpreted as shouting.

lowercase. Every letter is lowercase: "hello world". Common for URL slugs, email addresses, and code identifiers in some languages like Python module names.

Title Case. The first letter of each major word is capitalized: "The Quick Brown Fox". Used for headings, book titles, film titles, and article titles. Style guides differ on which small words (prepositions, articles) to capitalize.

Sentence case. Only the first letter of the first word is capitalized, along with proper nouns: "The quick brown fox". This is the default for body text, UI labels, and button text because it mirrors natural speech.

camelCase. The first word is lowercase; subsequent words begin with a capital letter, with no separators: "quickBrownFox". Widely used for variable and function names in JavaScript, TypeScript, Java, and Swift.

PascalCase. Every word begins with a capital letter, with no separators: "QuickBrownFox". Also called UpperCamelCase. Standard for class names, React components, TypeScript interfaces, and constructor functions.

snake_case. All lowercase, words separated by underscores: "quick_brown_fox". The dominant convention in Python for variables and functions, and in SQL for column and table names. Easy to read and sort alphabetically.

kebab-case. All lowercase, words separated by hyphens: "quick-brown-fox". Standard for CSS class names, HTML element IDs, URL slugs, and command-line flags. Cannot be used as-is in most programming languages because hyphens are interpreted as minus operators.

When Each Style Is Used

In programming. Most languages have documented conventions. JavaScript and TypeScript use camelCase for variables and functions, PascalCase for classes and components, and SCREAMING_SNAKE_CASE for constants. Python uses snake_case for almost everything except class names (PascalCase). Go uses camelCase, with capitalization also controlling visibility (exported vs. unexported identifiers).

In CSS and HTML. Class names and IDs use kebab-case by convention: ".nav-item", "#main-content". CSS custom properties follow the same pattern: "--color-primary". This convention exists because CSS is not case-sensitive and hyphens read well in stylesheet syntax.

In databases. SQL column and table names traditionally use snake_case because SQL keywords are case-insensitive and database identifiers are often stored and compared in lowercase. An identifier like "user_created_at" is unambiguous and easy to query.

In writing. Title Case appears in headings, headlines, and titles. Sentence case is standard for body text, UI copy, and most digital writing. UPPERCASE is reserved for abbreviations (HTML, CSS, API) and very emphatic short phrases.

In URLs and file names. kebab-case is preferred for both: "/how-to-count-words/" reads better than "/HowToCountWords/" and avoids issues with case-sensitive file systems and SEO. Spaces are never valid in URLs.

Common Mistakes

History

The distinction between uppercase and lowercase letters dates to the handwritten manuscripts of medieval Europe, where scribes used large decorative letters to open paragraphs and smaller letters for the text that followed. When Gutenberg introduced movable type in the 1440s, the two sizes of letters were stored in separate wooden cases in the print shop — capitals in the upper case, smaller letters in the lower case. Those physical terms survived into the digital age.

Programming naming conventions emerged independently in the late 20th century as each language community developed its own idioms. camelCase became dominant in C-derived languages partly because early editors had no autocomplete and long names needed to be readable without spaces. snake_case emerged in Unix and Python communities where readability and grep-friendliness were prioritized. The POSIX standard solidified lowercase naming for command-line tools and system identifiers.

CSS introduced kebab-case as the standard for property names in the late 1990s, and the web development community adopted it for class names and IDs by convention. Today, automated tools — linters, formatters, code generators — enforce case styles in large codebases so that conventions do not depend on individual discipline. Case conversion tools became common utilities for developers moving data between systems with different naming expectations.

Common Questions

What is text case conversion?

Text case conversion is the process of changing the capitalization pattern of a string — for example, turning "hello world" into "Hello World" or "HELLO_WORLD". It is useful in writing for consistency and in programming where variable naming conventions require specific formats like camelCase or snake_case.

What is the difference between camelCase and PascalCase?

In camelCase, the first word is lowercase and subsequent words start with a capital letter: "myVariableName". In PascalCase (also called UpperCamelCase), every word starts with a capital letter: "MyVariableName". camelCase is common for variable and function names in JavaScript; PascalCase is common for class names and React components.

When should I use snake_case vs kebab-case?

snake_case uses underscores to separate words and is common in Python variables, database column names, and file names: "user_profile_image". kebab-case uses hyphens and is common in CSS class names, HTML attributes, and URL slugs: "user-profile-image". The choice usually follows the convention of the language or system you are working in.

What is Title Case and when should I use it?

Title Case capitalizes the first letter of each major word: "The Quick Brown Fox". It is used for headings, article titles, book titles, and proper names. Style guides (AP, Chicago, APA) differ on which words to capitalize — generally short prepositions and articles like "a", "the", and "of" are kept lowercase unless they start the title.

View all questions →