Convert Text to Title Case
Learn how to convert text to Title Case where the first letter of each major word is capitalized. Understand title case rules, small-word exceptions, and style guide differences.
Detailed Explanation
Converting Text to Title Case
Title Case capitalizes the first letter of each major word while keeping certain small words (articles, prepositions, conjunctions) in lowercase — unless they are the first or last word. This is the standard for book titles, article headlines, and UI headings.
Basic Conversion
Input: the quick brown fox jumps over the lazy dog
Output: The Quick Brown Fox Jumps over the Lazy Dog
Notice that "over" and "the" (in the middle) remain lowercase because they are small words.
Small-Word Exceptions
Most style guides agree on keeping these words lowercase unless they start or end the title:
- Articles: a, an, the
- Prepositions (short): at, by, for, in, of, on, to, up, via
- Conjunctions: and, as, but, if, or, nor, so, yet
Different style guides (AP, APA, Chicago, MLA) disagree on some edge cases. For example, Chicago lowercases prepositions regardless of length, while AP capitalizes prepositions of four or more letters.
Naive vs. Proper Title Case
A naive approach simply capitalizes every first letter:
Naive: "The Quick Brown Fox Jumps Over The Lazy Dog"
Proper: "The Quick Brown Fox Jumps over the Lazy Dog"
The naive approach overcapitalizes small words, making it look incorrect to readers familiar with English typography conventions.
Hyphenated Words
Hyphenated words have special handling. Most style guides capitalize both parts:
"self-driving car" → "Self-Driving Car"
"well-known fact" → "Well-Known Fact"
Words with Internal Capitals
Words like "iPhone", "macOS", or "eBay" should ideally be preserved. A smart title case converter allows exception lists or detects words with internal capitals.
After Colons
Most style guides capitalize the first word after a colon:
"design patterns: a practical guide" → "Design Patterns: A Practical Guide"
Edge Cases
- All-uppercase input should be lowercased first, then title-cased.
- Acronyms like "HTML", "CSS", "API" should remain uppercase.
- Single-letter words like "I" and "A" follow normal capitalization rules.
Use Case
Title case is used for blog post titles, book and article headings, navigation menu items, email subject lines, product names, and any UI element where proper English capitalization rules must be applied consistently across a large volume of content.