Java Character isLetter() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
java.lang.Character

Definition

In Java, Character.isLetter(ch) returns true when the character is a letter and false otherwise. "Letter" means any Unicode letter, not only a to z: Greek, Cyrillic, Arabic, Hindi, and Chinese characters all count.

Under the hood, a character is a letter when its general category (see getType()) is UPPERCASE_LETTER, LOWERCASE_LETTER, TITLECASE_LETTER, MODIFIER_LETTER, or OTHER_LETTER. Digits, spaces, punctuation, and symbols such as $ are not letters.

A static method of java.lang.Character (Java 1.0+): call it on the class, as in Character.isLetter(...); 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

Pass a char, or an int code point for characters above U+FFFF.

Java
boolean a = Character.isLetter('q');       // true
boolean b = Character.isLetter('7');       // false
boolean c = Character.isLetter('\u03B1');  // true, Greek small alpha
boolean d = Character.isLetter(0x1D400);   // true, int code point overload
CallWhat it does
Character.isLetter(ch)Test one char.
Character.isLetter(text.charAt(i))Test the character at index i of a String.
Character.isLetter(text.codePointAt(i))Test a whole code point, which also works for characters stored as two chars.

There are two overloads: isLetter(char ch) and isLetter(int codePoint). A char cannot hold a character above U+FFFF on its own, so use the int version when the text may contain such characters.

Library declarations
Java
// java.lang.Character
public static boolean isLetter(char ch)
public static boolean isLetter(int codePoint)   // since Java 5

Parameters

ParameterDescription
ch (char)The character to test.
codePoint (int)The Unicode code point to test, normally 0 to 0x10FFFF.

Return Value

Return ValueDescription
trueThe character is a Unicode letter.
falseIt is a digit, space, punctuation mark, symbol, control code, surrogate half, or unassigned.

Compare with Similar Methods

Other tests that look similar:

MethodHow it differs
isAlphabetic(codePoint)Also true for letter numbers such as Roman numerals and for some vowel signs (Java 7+).
isLetterOrDigit(ch)Letters plus decimal digits.
isUpperCase(ch)Only uppercase characters, such as A to Z.
isJavaIdentifierStart(ch)Letters plus $, _, and a few more that may start a Java name.

Java Examples

Example 1 — Letters, Non-Letters, and Non-English Letters

Test ASCII characters, two symbols that are legal in Java names, and two characters from other scripts.

Java
public class CharacterIsLetterBasics {
    public static void main(String[] args) {
        char[] samples = {'a', 'Z', '7', ' ', '_', '$', '\u03B1', '\u4E2D'};
        for (char c : samples) {
            System.out.println((int) c + " -> " + Character.isLetter(c));
        }
    }
}

How It Works

  1. Numbers instead of glyphs. Printing (int) c shows each character's code, so Greek alpha appears as 945 and the Chinese character U+4E2D as 20013, and the console never has to draw a non-ASCII symbol.
  2. ASCII results. a and Z are letters. 7, the space, _, and $ are not; the last two are allowed in Java names, but Unicode files them as punctuation and a currency symbol.
  3. Any alphabet counts. Alpha is a lowercase letter and U+4E2D is an "other letter", so both return true.

Example 2 — Strip Everything Except Letters

Clean up a messy nickname by keeping the letters and counting what was thrown away.

Java
public class CharacterIsLetterFilter {
    public static void main(String[] args) {
        String input = "J4v@-Duke_2025!";
        StringBuilder letters = new StringBuilder();
        int dropped = 0;
        for (int i = 0; i < input.length(); i++) {
            char c = input.charAt(i);
            if (Character.isLetter(c)) {
                letters.append(c);
            } else {
                dropped++;
            }
        }
        System.out.println("letters: " + letters);
        System.out.println("dropped: " + dropped);
    }
}

How It Works

  1. Fifteen characters in. The input mixes letters with the digits 4, 2, 0, 2, 5 and the symbols @, -, _, and !.
  2. Letters go to the builder. Only J, v, D, u, k, and e pass isLetter, so the StringBuilder ends up holding JvDuke.
  3. The rest is counted. The five digits and four symbols take the else branch: 6 kept plus 9 dropped equals the input length of 15.

Example 3 — A Letter Above U+FFFF Needs the int Overload

MATHEMATICAL BOLD CAPITAL A (U+1D400) is a letter, but it is stored as two chars. Testing only the first char gives the wrong answer.

Java
public class CharacterIsLetterCodePoint {
    public static void main(String[] args) {
        String bold = "\uD835\uDC00";
        System.out.println("length: " + bold.length());
        System.out.println("isLetter(char at 0): " + Character.isLetter(bold.charAt(0)));
        int cp = bold.codePointAt(0);
        System.out.println("code point: 0x" + Integer.toHexString(cp));
        System.out.println("isLetter(code point): " + Character.isLetter(cp));
    }
}

How It Works

  1. One character, two chars. U+1D400 is above U+FFFF, so the string literal holds a surrogate pair and length() reports 2.
  2. Half a character is not a letter. charAt(0) returns the high surrogate '\uD835', whose category is SURROGATE, so the char overload says false.
  3. The full code point. codePointAt(0) combines both halves into 0x1d400, and isLetter(int) correctly reports an uppercase letter.

Frequently Asked Questions

No. It returns true for letters of every script that Unicode knows, such as Greek, Cyrillic, Arabic, Devanagari, and Chinese characters.
No. Character.isLetter('_') is false because the underscore is connector punctuation. It is still allowed in variable names, which is what isJavaIdentifierStart and isJavaIdentifierPart check.
isAlphabetic (Java 7+) accepts everything isLetter accepts, plus letter numbers such as Roman numerals and characters with the Unicode Other_Alphabetic property, such as many vowel signs.
Compare ranges instead: (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'). isLetter would also accept letters from other alphabets.
Whenever the text may contain characters above U+FFFF, such as historic scripts or mathematical letters. Read them with codePointAt and pass the int to isLetter.

Next: isLetterOrDigit()

Check whether a character is a letter or a decimal digit.

isLetterOrDigit() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

7 people found this page helpful