Quick reference
| Language | Lowercase | Uppercase |
|---|---|---|
| Python | s.lower() | s.upper() |
| JavaScript / TypeScript | s.toLowerCase() | s.toUpperCase() |
| Java | s.toLowerCase(Locale.ROOT) | s.toUpperCase(Locale.ROOT) |
| C# | s.ToLowerInvariant() | s.ToUpperInvariant() |
| PHP | mb_strtolower($s) | mb_strtoupper($s) |
| SQL | LOWER(col) | UPPER(col) |
| Bash 4+ | ${s,,} | ${s^^} |
| Go | strings.ToLower(s) | strings.ToUpper(s) |
| Ruby | s.downcase | s.upcase |
| Rust | s.to_lowercase() | s.to_uppercase() |
| Kotlin | s.lowercase() | s.uppercase() |
| Excel VBA | LCase(s) | UCase(s) |
Strings are immutable in most of these languages, so the function returns a new string — assign it: name = name.lower().

Convert your text here
Prefer to skip the menus? Paste the text below — it converts live.
0 characters · 0 words · 0 lines · 0 letters changed
Options
Python: lower() vs casefold()
"Straße".lower() # 'straße'
"Straße".casefold() # 'strasse'
lower() is right for displaying text. casefold() is designed for comparing strings regardless of case, so use it when checking whether two words match: a.casefold() == b.casefold().
JavaScript and locales
"TITLE".toLowerCase() // "title"
"TITLE".toLocaleLowerCase("tr-TR") // "tıtle" (dotless ı)
toLowerCase() uses language-neutral Unicode rules. toLocaleLowerCase() applies language-specific rules — needed for Turkish and Azerbaijani text, harmful for identifiers such as HTML tags or JSON keys.
The Turkish I problem
Turkish has four forms of the letter: I ı (dotless) and İ i (dotted). On a machine whose default locale is Turkish, a locale-sensitive lowercase turns “TITLE” into “tıtle”, so a comparison such as "TITLE".toLowerCase() == "title" can unexpectedly fail. That is why the Java and C# examples above use Locale.ROOT and ToLowerInvariant(): they behave the same on every computer.
PHP: strtolower vs mb_strtolower
strtolower() works byte by byte and only converts the ASCII letters A–Z, so accented letters such as “É” are left as they are. Use mb_strtolower($s, 'UTF-8') for text that may contain non-English characters.
SQL: lowercasing vs case-insensitive matching
UPDATE users SET email = LOWER(email);
SELECT * FROM users WHERE LOWER(email) = LOWER('[email protected]');
Wrapping a column in LOWER() inside a WHERE clause usually prevents the database from using a normal index on that column. For large tables, store values already lowercased, add an index on the expression where your database supports it, or use a case-insensitive collation.
Shell one-liners
echo "HELLO" | tr '[:upper:]' '[:lower:]' # hello
name="HELLO"; echo "${name,,}" # hello (Bash 4+)
macOS ships with Bash 3.2, which does not support ${name,,}; use tr there, or zsh’s ${name:l}.
Frequently asked questions
How do I convert a string to lowercase in Python?
Call the lower() method: new = text.lower(). For case-insensitive comparisons use casefold() instead, which also handles letters like German ß.
What is the difference between toLowerCase and toLocaleLowerCase in JavaScript?
toLowerCase uses language-neutral Unicode rules. toLocaleLowerCase applies the rules of a given language, which matters mainly for Turkish and Azerbaijani, where uppercase I becomes a dotless ı.
Why does strtolower not change accented letters in PHP?
strtolower only converts the ASCII letters A–Z. Use mb_strtolower with UTF-8 for full Unicode support.