Understanding the uppercase and lowercase converter — concept and principle
This converter changes text to ALL CAPITALS, all small letters, or swaps the case of every letter. It follows Unicode's case rules, so it works for accented Latin letters, Greek, Cyrillic and other cased scripts, not just A–Z, and it counts letters, capitals, words and characters.
How it is calculated
UPPERCASE: every letter → its default upper-case mapping
lowercase: every letter → its default lower-case mapping
sWAP cASE: capitals → small letters, small letters → capitals
Mappings come from the Unicode Character Database (UnicodeData.txt and SpecialCasing.txt), as used by toUpperCase() and toLowerCase()
Characters without case (digits, Hangul, Chinese characters, punctuation) stay as typed
The principle
Each cased letter in Unicode has defined upper- and lower-case partners. Most mappings are one-to-one, like é ↔ É or ж ↔ Ж, but some are one-to-many: the German ß becomes "SS" in capitals, so text can get longer when uppercased. The default mappings are language-neutral; some languages have special rules, such as Turkish dotted and dotless i, which need locale-aware functions and are not applied here.
Worked example
Default inputs: "the quick brown fox jumps over the lazy dog. ß and é work too.", UPPERCASE.
- Every small letter becomes a capital; ß becomes SS and é becomes É.
- Result: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG. SS AND É WORK TOO.
- Characters changed = 47, letters in the text = 47.
- Capital letters before conversion = 0; small letters = 47.
- Words = 14; characters (code points) = 62.
How to read the result
Use uppercase for short labels or acronyms, lowercase to clean up text typed with Caps Lock, and swap case to fix text typed with Caps Lock on by mistake. Long passages in capitals are harder to read, so avoid them for body text. If your language has special rules, check the result.
Common mistakes
- Expecting length to stay the same; ß → SS adds a character.
- Using all caps for long text, which reduces readability.
- Expecting Turkish İ/ı rules without a Turkish locale.
- Expecting Hangul to change; it has no case.
Frequently asked questions
Why did ß become SS?
German has no traditional capital ß in default mappings, so it is written SS in capitals.
Does it work with Greek and Cyrillic?
Yes, all scripts with case are converted.
What is swap case useful for?
Fixing text accidentally typed with Caps Lock on.
Will Korean text change?
No. Hangul has no upper or lower case.
Sources: The Unicode Standard 15.1, §3.13 Default Case Algorithms (UnicodeData.txt and SpecialCasing.txt) · MDN Web Docs, "String.prototype.toLocaleUpperCase()"