In Java, Character.isAlphabetic(codePoint) returns true when the code point has the Unicode Alphabetic property. That covers every character isLetter() accepts, plus two more groups.
The extra groups are letter numbers (category LETTER_NUMBER, such as ROMAN NUMERAL ONE, U+2160) and characters with the Other_Alphabetic property, such as many vowel signs in Indic scripts. If you are checking whether a word is "made of letters" in languages like Hindi, isAlphabetic is usually the better choice.
A static method of java.lang.Character (Java 7+): call it on the class, as in Character.isAlphabetic(...); you do not need a Character object. No import is needed, because java.lang is always available.
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
There is only an int overload; a char argument is widened to int automatically.
Java
Character.isAlphabetic('a'); // true (char widens to int)
Character.isAlphabetic('\u2160'); // true, ROMAN NUMERAL ONE
Character.isLetter('\u2160'); // false
Character.isAlphabetic('5'); // false
Find the "extra" alphabetic characters that are not letters.
Unlike most tests, isAlphabetic has no char overload because it was added in Java 7, after code point support. On Java 6 and older, the closest test is isLetter(cp) || Character.getType(cp) == Character.LETTER_NUMBER (which still misses Other_Alphabetic characters).
Library declarations
Java
// java.lang.Character (since Java 7)
public static boolean isAlphabetic(int codePoint)
Parameters
Parameter
Description
codePoint (int)
The Unicode code point to test. A char works too.
Return Value
Return Value
Description
true
The category is one of the five letter categories or LETTER_NUMBER, or the character has the Other_Alphabetic property.
false
Digits, punctuation, symbols, spaces, most combining accents, and invalid code points.
char literals in an int array.'a' and '7' are widened to 97 and 55, so code points and characters can share one array.
Two extra matches. ROMAN NUMERAL ONE (8544) is a letter number, and DEVANAGARI VOWEL SIGN AA (2366) has the Other_Alphabetic property, so isAlphabetic says true while isLetter says false.
Accents are not alphabetic. COMBINING ACUTE ACCENT (769) is a non-spacing mark without the Alphabetic property, so both tests reject it, just like the digit.
Example 2 — Check a Hindi Word Letter by Letter
The Hindi word "kaam" is written with a consonant, a vowel sign, and another consonant. Only one of the two tests accepts all three.
Java
public class CharacterIsAlphabeticWord {
public static void main(String[] args) {
String word = "\u0915\u093E\u092E";
boolean allLetters = true;
boolean allAlphabetic = true;
for (int i = 0; i < word.length(); i++) {
char c = word.charAt(i);
allLetters &= Character.isLetter(c);
allAlphabetic &= Character.isAlphabetic(c);
}
System.out.println("chars: " + word.length());
System.out.println("all isLetter: " + allLetters);
System.out.println("all isAlphabetic: " + allAlphabetic);
}
}
Output
chars: 3
all isLetter: false
all isAlphabetic: true
How It Works
Escapes keep the source ASCII.\u0915 is the consonant KA, \u093E the vowel sign AA, and \u092E the consonant MA; all three fit in single chars.
An AND that accumulates.allLetters &= ... stays true only while every character passes, so one failure is enough to flip it.
The vowel sign decides. U+093E is a spacing combining mark, not a letter, so isLetter rejects the word; its Other_Alphabetic property makes isAlphabetic accept it.
Example 3 — Count Alphabetic Code Points, Including One Above U+FFFF
Loop by code point so that MATHEMATICAL BOLD CAPITAL A (two chars) is tested as one character.
Java
public class CharacterIsAlphabeticCodePoints {
public static void main(String[] args) {
String s = "X\u2161\uD835\uDC00!";
int alphabetic = 0;
int codePoints = 0;
for (int i = 0; i < s.length(); ) {
int cp = s.codePointAt(i);
codePoints++;
if (Character.isAlphabetic(cp)) {
alphabetic++;
}
i += Character.charCount(cp);
}
System.out.println("chars=" + s.length() + " codePoints=" + codePoints + " alphabetic=" + alphabetic);
}
}
Output
chars=5 codePoints=4 alphabetic=3
How It Works
Five chars, four characters. X, ROMAN NUMERAL TWO (U+2161), the surrogate pair for U+1D400, and the exclamation mark.
Advance by charCount. The loop has no update in its header; i += Character.charCount(cp) moves 2 positions after the bold A and 1 position otherwise.
Three alphabetic. X and the bold A are letters, the Roman numeral is a letter number, and only ! is rejected.
Frequently Asked Questions
Java 7. On Java 6 and older the method does not exist; isLetter is the closest alternative.
It was added after Java 5 introduced code point support, so only the int version was provided. Passing a char still compiles because char widens to int.
Yes. Everything isLetter accepts, isAlphabetic accepts too. The reverse is not true.
Yes. The Roman numeral characters starting at U+2160 have the category LETTER_NUMBER, which isAlphabetic accepts and isLetter rejects.
Usually not. Combining accents such as U+0301 are not alphabetic, but many vowel signs in Indic scripts are, because they carry the Other_Alphabetic property.