In Java, Character.toLowerCase(ch) returns the lowercase form of a character: 'A' becomes 'a', Greek capital alpha becomes small alpha. Characters with no lowercase form, such as digits, punctuation, and letters that are already lowercase, come back unchanged.
It uses the simple, one-to-one mapping from the Unicode data, and it never looks at the locale. For whole words, or for language rules such as Turkish dotted and dotless i, use String.toLowerCase(Locale).
A static method of java.lang.Character (Java 1.0+): call it on the class, as in Character.toLowerCase(...); you do not need a Character object. No import is needed, because java.lang is always available. The int codePoint overload was added in Java 5.
Unicode version.
The answer comes from the Unicode Character Database built into your JDK, and each Java release follows a specific Unicode version (Java 8, for example, uses Unicode 6.2). The characters used on this page have had the same properties for many Unicode versions, so the examples print the same result on any current JDK.
Syntax
The char overload returns a char; the int overload returns an int code point.
Java
char a = Character.toLowerCase('A'); // 'a'
char b = Character.toLowerCase('a'); // 'a', already lowercase
char c = Character.toLowerCase('7'); // '7', no case
int d = Character.toLowerCase(0x0391); // 0x03B1 (945), Greek small alpha
Compare two characters ignoring case (for most scripts).
Character.toLowerCase(s.codePointAt(i))
Lowercase a full code point.
Overloads: char toLowerCase(char ch) and int toLowerCase(int codePoint). Keep the result type in mind: printing the int version shows a number, not a letter.
Library declarations
Java
// java.lang.Character
public static char toLowerCase(char ch)
public static int toLowerCase(int codePoint) // since Java 5
Parameters
Parameter
Description
ch (char)
The character to convert.
codePoint (int)
The code point to convert.
Return Value
Return Value
Description
char / int
The lowercase equivalent, or the argument itself if it has none.
Compare with Similar Methods
Other ways to change or test case:
Method
How it differs
String.toLowerCase(Locale)
Converts a whole string with the rules of a language.
Example 1 — Lowercase Text One Character at a Time
Build a lowercase copy of a mixed-case string with a StringBuilder.
Java
public class CharacterToLowerCaseText {
public static void main(String[] args) {
String text = "HeLLo, JAVA 8!";
StringBuilder lower = new StringBuilder(text.length());
for (int i = 0; i < text.length(); i++) {
lower.append(Character.toLowerCase(text.charAt(i)));
}
System.out.println(lower);
}
}
Output
hello, java 8!
How It Works
A builder with room.new StringBuilder(text.length()) reserves space for all 14 characters up front.
The char overload.charAt(i) is a char, so toLowerCase returns a char and append adds it as a letter, not a number.
No case, no change. The comma, spaces, 8, and ! pass through as they are; only H, L, L, J, A, V, and A change.
Example 2 — Count a Letter Without Caring About Case
Count every s and S in a phrase by lowercasing each character before comparing.
Java
public class CharacterToLowerCaseCount {
public static void main(String[] args) {
String phrase = "Mississippi STATE SALES";
char target = 'S';
int count = 0;
for (char c : phrase.toCharArray()) {
if (Character.toLowerCase(c) == Character.toLowerCase(target)) {
count++;
}
}
System.out.println("'" + target + "' appears " + count + " times");
}
}
Output
'S' appears 7 times
How It Works
Normalise both sides. Lowercasing both the current character and the target means 'S', 's', and any mix match each other.
Comparing chars with ==.char is a primitive, so == compares the values directly; no equals is needed.
The tally. "Mississippi" has four s, "STATE" one S, and "SALES" two, so the total is 7.
Example 3 — Lowercase Code Points, Including One Above U+FFFF
The int overload handles Greek, accented Latin, and the Deseret alphabet (above U+FFFF). The char overload cannot handle the last one.
Java
public class CharacterToLowerCaseCodePoints {
public static void main(String[] args) {
int[] cps = {'Q', 0x00C9, 0x0391, 0x10400};
for (int cp : cps) {
System.out.println(cp + " -> " + Character.toLowerCase(cp));
}
String deseret = "\uD801\uDC00";
System.out.println("char version on a surrogate: " + (int) Character.toLowerCase(deseret.charAt(0)));
}
}
Output
81 -> 113
201 -> 233
913 -> 945
66560 -> 66600
char version on a surrogate: 55297
How It Works
int in, int out. Because cp is an int, the code point overload runs and the results print as numbers: Q (81) becomes q (113), E with acute (201) becomes e with acute (233).
Beyond the BMP. DESERET CAPITAL LETTER LONG I is U+10400 (66560); its lowercase partner is U+10428 (66600).
The char overload gives up. The same letter stored in a String starts with the high surrogate 0xD801 (55297), which has no case, so toLowerCase(char) returns it unchanged.
Frequently Asked Questions
The same character. Digits, spaces, and punctuation have no lowercase form, so they are returned unchanged.
No. It always uses the Unicode simple case mapping. String.toLowerCase(Locale) is the locale-aware choice.
The int overload returns an int code point. Cast to char for BMP characters, or use new String(Character.toChars(cp)) for any code point.
Compare Character.toLowerCase(a) == Character.toLowerCase(b). For full Unicode accuracy also compare the uppercase forms, which is what String.equalsIgnoreCase does.
No. It always returns a single char or code point. Multi-character mappings only happen in String.toLowerCase.