You pasted a heading and it's all caps. Or you typed a paragraph without realizing caps lock was on. Or you need to convert a list of product names into title case for a catalog. Whatever the reason, changing text case is one of those tasks that comes up constantly - and doing it by hand is tedious.
The good news: there's a fast way to do it no matter what tool you're working in. This guide covers every approach - from browser tools that handle it in seconds to code snippets you can drop into a project.
Quick reference: Common text cases
| Case | Example |
|---|---|
| UPPERCASE | THE QUICK BROWN FOX JUMPS |
| lowercase | the quick brown fox jumps |
| Title Case | The Quick Brown Fox Jumps |
| Sentence case | The quick brown fox jumps |
| camelCase | theQuickBrownFoxJumps |
| PascalCase | TheQuickBrownFoxJumps |
| snake_case | the_quick_brown_fox_jumps |
| kebab-case | the-quick-brown-fox-jumps |
The Quick Way: Use a Browser Tool
If you just need to convert some text right now, a browser-based tool is the fastest approach. Paste your text in, pick the case you want, copy the result.
The Text Case Converter handles all the common conversions: uppercase, lowercase, title case, sentence case, alternating case, and more. Everything runs in your browser - nothing gets sent to a server.
Quick steps:
- Go to articleformatter.com/text-case-converter
- Paste your text into the input area
- Click the case you want (Uppercase, Lowercase, Title Case, etc.)
- Copy the converted text from the output
This works well for one-off conversions - fixing a heading, reformatting a list of names, cleaning up text you copied from somewhere. For bulk processing or automation, keep reading.
Word Processors: Word, Google Docs, and Notepad++
If you're already working in a document editor, you don't need to leave it. Most word processors have case conversion built in.
Microsoft Word
Select the text you want to change, then use one of these methods:
- Keyboard shortcut: Press
Shift+F3to cycle through lowercase, UPPERCASE, and Title Case. Keep pressing to cycle through all three. - Ribbon: Go to Home tab, click the "Aa" button (Change Case), and pick from Sentence case, lowercase, UPPERCASE, Capitalize Each Word, or tOGGLE cASE.
The Shift+F3 shortcut is the one most people use day to day. It's quick and doesn't require taking your hands off the keyboard.
Google Docs
Select your text, then go to Format > Text > Capitalization. You get three options: lowercase, UPPERCASE, and Title Case. No keyboard shortcut by default, but you can assign one through Google Docs add-ons.
Notepad++
Select the text and use the Edit menu or these shortcuts:
Ctrl+Shift+U- UPPERCASECtrl+U- lowercase
For title case and sentence case in Notepad++, you'll need a plugin or a find-and-replace regex.
VS Code
Select text, then open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on Mac). Type "transform" and you'll see options for Transform to Uppercase, Transform to Lowercase, Transform to Title Case, and Transform to Snake Case. You can also bind these to keyboard shortcuts.
JavaScript: Change Case Programmatically
JavaScript has built-in methods for basic case conversion, and you can build more sophisticated transforms from there.
Built-in Methods
const text = "Hello World";
// Basic conversions
text.toUpperCase(); // "HELLO WORLD"
text.toLowerCase(); // "hello world" These two handle most situations. But JavaScript doesn't have built-in title case or sentence case, so you need to write those yourself.
Title Case
A simple title case function capitalizes the first letter of every word:
function toTitleCase(str) {
return str.toLowerCase().replace(/\b\w/g, c => c.toUpperCase());
}
toTitleCase("the quick brown fox");
// "The Quick Brown Fox" But real title case is more nuanced. Style guides say certain short words - "a", "an", "the", "and", "but", "or", "in", "on", "at", "to", "for" - should stay lowercase unless they're the first word. Here's a version that handles that:
function toProperTitleCase(str) {
const minor = new Set([
'a','an','the','and','but','or','nor','for',
'yet','so','in','on','at','to','by','of','up'
]);
return str.toLowerCase().split(' ').map((word, i) =>
i === 0 || !minor.has(word)
? word.charAt(0).toUpperCase() + word.slice(1)
: word
).join(' ');
}
toProperTitleCase("the lord of the rings");
// "The Lord of the Rings" Sentence Case
function toSentenceCase(str) {
return str.toLowerCase().replace(/(^\s*\w|[.!?]\s+\w)/g,
c => c.toUpperCase()
);
}
toSentenceCase("hello world. this is a test.");
// "Hello world. This is a test." Developer Cases: camelCase, PascalCase, snake_case, kebab-case
If you're working with code - converting between naming conventions, generating variable names from labels, or building API field mappers - you'll need these:
// Split any string into words first
function getWords(str) {
return str
.replace(/([a-z])([A-Z])/g, '$1 $2') // camelCase boundaries
.replace(/[_\-]+/g, ' ') // underscores and hyphens
.trim().toLowerCase().split(/\s+/);
}
function toCamelCase(str) {
const words = getWords(str);
return words[0] + words.slice(1)
.map(w => w.charAt(0).toUpperCase() + w.slice(1))
.join('');
}
function toPascalCase(str) {
return getWords(str)
.map(w => w.charAt(0).toUpperCase() + w.slice(1))
.join('');
}
function toSnakeCase(str) {
return getWords(str).join('_');
}
function toKebabCase(str) {
return getWords(str).join('-');
}
// Examples
toCamelCase("user first name"); // "userFirstName"
toPascalCase("user first name"); // "UserFirstName"
toSnakeCase("User First Name"); // "user_first_name"
toKebabCase("userFirstName"); // "user-first-name" For production code, the change-case npm package handles all of these (plus dot.case, path/case, CONSTANT_CASE, and more) with proper edge-case handling.
Python: String Case Methods
Python's string type has case conversion methods built right in. They're straightforward and handle Unicode properly.
Built-in Methods
text = "hello world. this is python."
text.upper() # "HELLO WORLD. THIS IS PYTHON."
text.lower() # "hello world. this is python."
text.title() # "Hello World. This Is Python."
text.capitalize() # "Hello world. this is python."
text.swapcase() # "HELLO WORLD. THIS IS PYTHON."
The title() method capitalizes every word, which works fine for most situations. But it treats apostrophes as word boundaries, so "it's" becomes "It'S". For proper title case that follows style guide rules, use the titlecase library:
# pip install titlecase
from titlecase import titlecase
titlecase("the lord of the rings")
# "The Lord of the Rings"
titlecase("it's a wonderful life")
# "It's a Wonderful Life" Processing Files
If you need to convert case across an entire file - say, a CSV of product names that need to be title-cased:
import csv
with open('products.csv', 'r') as infile, open('output.csv', 'w', newline='') as outfile:
reader = csv.reader(infile)
writer = csv.writer(outfile)
for row in reader:
# Title-case the first column (product name)
row[0] = row[0].title()
writer.writerow(row) Command Line: tr, awk, and sed
For batch operations on files or piping text through a terminal, command-line tools work well.
tr (translate characters)
# Uppercase
echo "hello world" | tr '[:lower:]' '[:upper:]'
# HELLO WORLD
# Lowercase
echo "HELLO WORLD" | tr '[:upper:]' '[:lower:]'
# hello world
The tr command only handles uppercase and lowercase. For title case, you'll need awk or sed.
awk
# Uppercase
echo "hello world" | awk '{print toupper($0)}'
# Lowercase
echo "HELLO WORLD" | awk '{print tolower($0)}'
# Title Case (capitalize first letter of each word)
echo "hello world" | awk '{for(i=1;i<=NF;i++) $i=toupper(substr($i,1,1)) tolower(substr($i,2))}1'
# Hello World sed
# Uppercase (GNU sed)
echo "hello world" | sed 's/.*/\U&/'
# Lowercase (GNU sed)
echo "HELLO WORLD" | sed 's/.*/\L&/'
# Capitalize first letter of each word (GNU sed)
echo "hello world" | sed 's/\b\w/\u&/g'
Note that the \U, \L, and \u escapes are GNU sed extensions. On macOS, use gsed (install via Homebrew: brew install gnu-sed) or use awk instead.
Processing Entire Files
# Convert a whole file to uppercase and save
tr '[:lower:]' '[:upper:]' < input.txt > output.txt
# In-place lowercase with sed (GNU)
sed -i 's/.*/\L&/' file.txt
# PowerShell (Windows)
(Get-Content file.txt).ToUpper() | Set-Content output.txt
(Get-Content file.txt).ToLower() | Set-Content output.txt CSS: Visual Case Changes Without Modifying Text
Sometimes you don't need to actually change the text - you just need it to display differently. CSS can handle that without touching the source data.
.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; } /* Title Case */ This is useful for headings, navigation labels, and buttons where you want consistent case regardless of how the content is entered. The original text stays untouched in the HTML - only the visual rendering changes. Screen readers still see the original case, and copying the text gives you the original too.
When to use CSS vs actual conversion: Use CSS when the case is purely visual (headings, nav labels). Actually convert the text when the data itself needs to be in a specific case (database entries, file names, API fields, exported data).
Title Case: Getting It Right
Title case is the trickiest to implement correctly because different style guides have different rules. Here's a comparison:
| Style Guide | Lowercase Words | Example |
|---|---|---|
| AP Style | Words with 3 or fewer letters (a, an, the, and, but, or, for, nor, in, on, at, to, etc.) | A Walk in the Park |
| APA Style | Short conjunctions, articles, and prepositions (3 or fewer letters) | A Walk in the Park |
| Chicago Manual | Articles, coordinating conjunctions, prepositions (regardless of length) | A Walk in the Park |
| Simple/Naive | None - capitalize every word | A Walk In The Park |
All style guides agree on one thing: always capitalize the first and last word of a title, regardless of what part of speech it is.
Method Comparison
| Method | Best For | Cases Supported |
|---|---|---|
| Browser tool | Quick one-off conversions | All common cases |
| Word / Google Docs | Converting text while writing | Upper, lower, title, sentence |
| JavaScript | Web apps, Node.js scripts | All (with custom functions) |
| Python | Data processing, scripts | All (built-in + titlecase lib) |
| Command line (tr/awk/sed) | Batch file processing | Upper, lower, title |
| CSS text-transform | Visual-only changes on web pages | Upper, lower, capitalize |
Common Scenarios
Fixing accidental caps lock
Paste the text into the Text Case Converter and click Sentence Case or lowercase. Or in Word, select the text and press Shift+F3.
Converting CSV column to title case
Use Python's csv module and the titlecase library for proper title case, or the built-in .title() method for quick-and-dirty conversion.
Making headings consistent across a website
Use text-transform: capitalize in your CSS to enforce title case visually. This way the display stays consistent even if content is entered in different cases.
Converting variable names between naming conventions
Use the JavaScript change-case npm package or write your own converter using the word-splitting approach shown above. Split on boundaries (spaces, underscores, hyphens, camelCase transitions), then rejoin in the target format.
Batch-converting filenames
On Linux/Mac, use a for loop with tr or mv. On Windows, PowerShell's Rename-Item with .ToLower() works well.
Tips for Better Results
- Watch for proper nouns. Automated title case and sentence case don't know that "iPhone", "McDonald's", or "NASA" have special capitalization. You'll need to fix those manually or maintain an exceptions list.
- Apostrophes can trip up naive implementations. Python's
.title()turns "it's" into "It'S" because it treats the apostrophe as a word boundary. Use thetitlecaselibrary to handle this correctly. - Unicode matters. The German "ss" should become "SS" in uppercase (not a single character). Turkish has dotted and dotless i. Python and modern JavaScript handle these correctly with locale-aware methods, but older tools and simple regex may not.
- Pick one convention and stick with it. Mixing title case and sentence case in the same document or UI looks inconsistent. Choose one style for headings, one for buttons, and one for body text.
- CSS is reversible, text changes aren't. If you're unsure about a permanent change, use CSS
text-transformfirst. You can always change your mind later without touching the data.
Frequently Asked Questions
What is the fastest way to change text case?
What is title case and when should I use it?
How do I change text case in Microsoft Word?
How do I convert text to uppercase in Python?
text.upper() for UPPERCASE, text.lower() for lowercase, text.title() for Title Case, and text.capitalize() for Sentence case. For proper title case following style guide rules, use the titlecase library from PyPI.