Java Character Methods

Beginner
7 min read
Updated: Nov 2026
52 method guides
Method index

About This Index

This page is the Java Character Methods index. Each row links to a full guide with syntax, parameters, return value, three runnable examples, and FAQs. Every example is a complete Java class with a main method and fixed data, so the output shown is the output you get.

Learn what the Character class is on the Character hub. Use this page when you need a specific method such as isLetter(), toUpperCase(), or digit(). The examples compile on Java 8 and later, except codePointOf() (Java 9) and one toString() example that uses the Java 11 code point overload.

char or code point?

A char is one 16-bit UTF-16 unit, which covers U+0000 to U+FFFF. Characters above that, such as the emoji U+1F600, are stored as two char values called a surrogate pair. That is why most methods here come in two versions: one that takes a char and one that takes an int code point. Prefer the int version when your text may contain emoji or rare scripts.

How to Call a Character Method

Most methods are static, so you call them on the class name and pass the character. No import is needed:

Java
char c = 'q';
boolean letter = Character.isLetter(c);          // true
char upper = Character.toUpperCase(c);           // 'Q'
int seven = Character.digit('7', 10);            // 7
int cp = Character.codePointAt("\uD83D\uDE00", 0); // 128512 (U+1F600)

Character boxed = c;                             // autoboxing
boolean same = boxed.equals('q');                // true (instance method)

Java Character Methods Table

All method guides in this Java tutorial series (52 tutorials), grouped by purpose.

Character tests

10 methods

Ask what kind of character you have: a letter, a digit, a space, a control code, a CJK ideograph, or a character that has a mirrored form.

MethodDescriptionTutorial
isLetter()Check whether a character is a letter in any language.Try it
isDigit()Check whether a character is a decimal digit, such as 0 to 9.Try it
isLetterOrDigit()Check whether a character is a letter or a decimal digit.Try it
isAlphabetic()Check the Unicode Alphabetic property, a wider test than isLetter (Java 7+).Try it
isIdeographic()Check whether a code point is a CJK ideograph, such as a Chinese character (Java 7+).Try it
isWhitespace()Check whether a character is whitespace by Java's rules (spaces, tabs, line breaks).Try it
isSpaceChar()Check for Unicode space, line, and paragraph separators, including the non-breaking space.Try it
isISOControl()Check for ISO control characters: codes 0x00 to 0x1F and 0x7F to 0x9F.Try it
isDefined()Check whether a character is assigned a meaning in Unicode.Try it
isMirrored()Check whether a character's glyph is flipped in right-to-left text, like brackets.Try it

Case tests and case conversion

6 methods

Check whether a character is lowercase, uppercase, or titlecase, and convert one character at a time.

MethodDescriptionTutorial
isLowerCase()Check whether a character is lowercase, such as a to z.Try it
isUpperCase()Check whether a character is uppercase, such as A to Z.Try it
isTitleCase()Check for titlecase letters, the "capitalised" form of digraphs such as Dz.Try it
toLowerCase()Convert one character to lowercase, using Unicode rules.Try it
toUpperCase()Convert one character to uppercase, using Unicode rules.Try it
toTitleCase()Convert a character to titlecase, the form used at the start of a word.Try it

Digits and numeric values

3 methods

Turn a digit character into its number in any base from 2 to 36, turn a number back into a digit character, or read the Unicode numeric value.

MethodDescriptionTutorial
digit()Get the numeric value of a digit character in a given radix, or -1.Try it
forDigit()Turn a number from 0 to 35 into its digit character for a given radix.Try it
getNumericValue()Get the Unicode numeric value of a character, such as 50 for the Roman numeral L.Try it

Unicode code points and surrogates

16 methods

Work with full Unicode code points, including emoji and other characters above U+FFFF that need two char values (a surrogate pair).

MethodDescriptionTutorial
charCount()Tell whether a code point needs 1 or 2 chars in UTF-16.Try it
codePointAt()Read the full code point at an index of a char sequence or char array.Try it
codePointBefore()Read the full code point that ends just before an index.Try it
codePointCount()Count the code points (real characters) in a range of text.Try it
offsetByCodePoints()Move an index forward or backward by a number of code points.Try it
isValidCodePoint()Check that an int is a valid Unicode code point (0 to 0x10FFFF).Try it
isBmpCodePoint()Check whether a code point fits in a single char (U+0000 to U+FFFF, Java 7+).Try it
isSupplementaryCodePoint()Check whether a code point is above U+FFFF and needs a surrogate pair.Try it
isHighSurrogate()Check whether a char is the first half of a surrogate pair (0xD800 to 0xDBFF).Try it
isLowSurrogate()Check whether a char is the second half of a surrogate pair (0xDC00 to 0xDFFF).Try it
isSurrogate()Check whether a char is either half of a surrogate pair (Java 7+).Try it
isSurrogatePair()Check whether two chars form a valid surrogate pair, in the right order.Try it
highSurrogate()Get the high (leading) surrogate char of a supplementary code point (Java 7+).Try it
lowSurrogate()Get the low (trailing) surrogate char of a supplementary code point (Java 7+).Try it
toCodePoint()Combine a high and a low surrogate into one supplementary code point.Try it
toChars()Convert a code point into its UTF-16 chars: one char, or a surrogate pair.Try it

Java and Unicode identifiers

5 methods

Check which characters may start or continue a Java variable name, or a Unicode identifier, and which ones are ignored inside identifiers.

MethodDescriptionTutorial
isJavaIdentifierStart()Check whether a character may be the first character of a Java identifier.Try it
isJavaIdentifierPart()Check whether a character may appear after the first character of a Java identifier.Try it
isUnicodeIdentifierStart()Check whether a character may start an identifier under the Unicode rules.Try it
isUnicodeIdentifierPart()Check whether a character may appear inside an identifier under the Unicode rules.Try it
isIdentifierIgnorable()Check whether a character is ignorable inside a Java or Unicode identifier.Try it

Type, direction, and name

4 methods

Read the Unicode general category, the bidirectional (left-to-right or right-to-left) class, or the official Unicode name of a character, and look a character up by name.

MethodDescriptionTutorial
getType()Get the Unicode general category of a character as an int constant.Try it
getDirectionality()Get the bidirectional (left-to-right or right-to-left) class of a character.Try it
getName()Get the official Unicode name of a code point, such as LATIN CAPITAL LETTER A (Java 7+).Try it
codePointOf()Look up a code point by its Unicode name, such as "GRINNING FACE" (Java 9+).Try it

Compare, equality, and hash codes

4 methods

Order two characters, check whether two Character objects hold the same value, and get a hash code.

MethodDescriptionTutorial
compare()Compare two primitive char values numerically (Java 7+).Try it
compareTo()Compare two Character objects by their numeric char values.Try it
equals()Check whether an object is a Character holding the same char value.Try it
hashCode()Get the hash code of a char: simply its numeric value.Try it

Boxing, unboxing, and conversion

4 methods

Wrap a char in a Character object, unwrap it again, turn it into a String, or swap its two bytes.

MethodDescriptionTutorial
valueOf()Wrap a char in a Character object, reusing cached objects for ASCII.Try it
charValue()Get the primitive char stored inside a Character object.Try it
toString()Turn a char, a Character, or (Java 11+) a code point into a String.Try it
reverseBytes()Swap the two bytes of a char, converting between big-endian and little-endian.Try it

Frequently Asked Questions

They are the methods of java.lang.Character. Most are static helpers that test or convert a single character, such as isLetter, isDigit, toUpperCase, and digit. A few, such as charValue, equals, and compareTo, are instance methods on a Character object.
This index lists 52 guides, from charCount() and charValue() to toUpperCase() and valueOf(), grouped by what they do. Most test and conversion methods have two overloads: one for a char and one for an int code point.
A char holds one 16-bit UTF-16 unit, which cannot represent characters above U+FFFF, such as most emoji. The int overloads take a full Unicode code point, so they work for every character.
No. Every class in java.lang is imported automatically, so you can write Character.isLetter(c) in any Java file.
Everything here works on Java 8 except codePointOf(), which needs Java 9, and the toString(int codePoint) overload, which needs Java 11. Several methods, such as isAlphabetic(), getName(), and compare(), were added in Java 7.

Start with isLetter()

The most common character test: is this char a letter?

isLetter() 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.

12 people found this page helpful