# Case converter: title, sentence, upper and lower case

> Convert text to title case, sentence case, UPPER or lower case, or to camelCase, snake_case and kebab-case, with character and word counts.

Interactive version: https://www.calcopenly.com/everyday/case-converter
Subject: Everyday calculators

The converter rewrites text in seven cases at once. Upper and lower case follow the Unicode default case mappings, so ß becomes SS. Title case capitalizes every word except articles, conjunctions and prepositions of three letters or fewer, which stay lowercase unless they come first, last or after a colon (AP style). Sentence case lowercases everything, then capitalizes the first letter of each sentence and the pronoun I. camelCase, snake_case and kebab-case split the text into words at spaces, punctuation and lower-to-upper changes, and drop apostrophes.

People use it to fix headings typed in capitals, format titles and turn phrases into variable names. The default, "the quick brown fox jumps over the lazy dog", becomes "The Quick Brown Fox Jumps Over the Lazy Dog" in title case and the_quick_brown_fox_jumps_over_the_lazy_dog in snake_case; it has 43 characters and 9 words.

Title and sentence case lower existing capitals first, so acronyms such as NASA and proper nouns need fixing by hand.

## Inputs

- **Text**
- **Show first** (options: UPPER CASE, lower case, Title Case, Sentence case, camelCase, snake_case, kebab-case)

## Results

- Title Case — main result
- UPPER CASE
- lower case
- Sentence case
- camelCase
- snake_case
- kebab-case
- Characters
- Words

## Worked examples

### Pangram

- Text: the quick brown fox jumps over the lazy dog
- Show first: Title Case
- **Title Case: The Quick Brown Fox Jumps Over the Lazy Dog**
- **UPPER CASE: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG**
- **camelCase: theQuickBrownFoxJumpsOverTheLazyDog**
- **snake_case: the_quick_brown_fox_jumps_over_the_lazy_dog**
- **kebab-case: the-quick-brown-fox-jumps-over-the-lazy-dog**
- **Characters: 43**
- **Words: 9**
- Checked against: Python 3.8 str.upper and an independent re-based implementation of the AP title rule

### Title with a colon

- Text: the lord of the rings: the return of the king
- Show first: Title Case
- **Title Case: The Lord of the Rings: The Return of the King**
- Checked against: AP rule: short function words stay lowercase except first, last and after a colon (Python check)

### Sentence case with a lone i

- Text: HELLO WORLD. how ARE you? i am fine
- Show first: Sentence case
- **Sentence case: Hello world. How are you? I am fine**
- Checked against: Python 3.8 re implementation: capitalize after . ! ? and the pronoun I

### Acronym and camel humps

- Text: XMLHttpRequest parser
- Show first: snake_case
- **snake_case: xml_http_request_parser**
- **camelCase: xmlHttpRequestParser**
- **kebab-case: xml-http-request-parser**
- Checked against: Python 3.8 re split at [a-z0-9][A-Z] and [A-Z]+[A-Z][a-z] boundaries

### Apostrophes and hyphens in identifiers

- Text: don't stop-me now
- Show first: camelCase
- **camelCase: dontStopMeNow**
- Checked against: Python 3.8 re implementation: apostrophes dropped, hyphen splits words

### German sharp s uppercases to SS

- Text: straße
- Show first: UPPER CASE
- **UPPER CASE: STRASSE**
- **Characters: 6**
- Checked against: Unicode full case mapping (SpecialCasing.txt); Python 3.8 'straße'.upper()

## Questions

### Which words are not capitalized in title case?

In AP style, articles (a, an, the) and conjunctions and prepositions of three letters or fewer (and, but, for, nor, or, so, yet, as, at, by, in, of, off, on, per, to, up, via) stay lowercase unless they are the first or last word or follow a colon. Words of four letters or more, such as "over" and "with", are capitalized. The Chicago Manual of Style differs: it lowercases prepositions of any length, such as "between".

### What is the difference between title case and sentence case?

Title case capitalizes most words (How to Write a Good Title); sentence case capitalizes only the first word, proper nouns and the pronoun I (How to write a good title). APA Style uses sentence case for the titles of articles and books in reference lists and title case for headings and for titles mentioned in the text.

### What are camelCase, snake_case and kebab-case?

They join words without spaces so a phrase can be used as a name in code. camelCase capitalizes each word after the first (xmlHttpRequestParser), snake_case joins lowercase words with underscores (xml_http_request_parser) and kebab-case with hyphens (xml-http-request-parser). Python's PEP 8 style guide uses snake_case for function and variable names; kebab-case appears in CSS property names such as background-color and in URLs.

### Why does ß become SS in upper case?

The Unicode Standard's default full case mapping, listed in SpecialCasing.txt, maps the German sharp s (ß) to the two letters SS, so "straße" (6 characters) becomes "STRASSE" (7). A capital sharp s, ẞ, was added in Unicode 5.1 in 2008, but the default uppercase mapping still gives SS. The character count here is for the text you typed.

### Does the character count include spaces?

Yes. Characters counts everything you typed, spaces and punctuation included, and the chart splits the total into uppercase and lowercase letters, digits, spaces and other characters. The default sentence has 43 characters: 35 lowercase letters and 8 spaces. Each Unicode code point counts once, so some emoji count as two. Words are runs of text between spaces that contain a letter or digit.

### How accurate is the case converter?

Accuracy depends on your inputs and the method's assumptions. Decimal arithmetic uses 50 significant digits, but estimates, numerical methods and source data can be less precise; the displayed rounding does not remove those limits. It is checked against 6 worked examples whose answers come from independent sources; for example, “Pangram” is checked against Python 3.8 str.upper and an independent re-based implementation of the AP title rule.

### Where does the method come from?

Unicode Standard §3.13 — Default case algorithms (full case mapping, e.g. ß → SS); AP Stylebook — Composition titles (capitalize words of four or more letters).

## Sources

- [Unicode Standard §3.13 — Default case algorithms (full case mapping, e.g. ß → SS)](https://www.unicode.org/versions/latest/core-spec/chapter-3/)
- [AP Stylebook — Composition titles (capitalize words of four or more letters)](https://www.apstylebook.com/)
