Java Character isUpperCase() Method

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

Definition

In Java, Character.isUpperCase(ch) returns true when the character is uppercase: A to Z, and capital letters of other scripts, such as Greek capital alpha (U+0391) and E with acute (U+00C9).

Formally, the category is UPPERCASE_LETTER; since Java 7, characters with the Unicode Other_Uppercase property count too. Digits and punctuation have no case and return false.

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

Java
Character.isUpperCase('Q');        // true
Character.isUpperCase('q');        // false
Character.isUpperCase('\u0391');   // true, Greek capital alpha
Character.isUpperCase('!');        // false
CallWhat it does
Character.isUpperCase(s.charAt(0))Does the word start with a capital?
if (Character.isUpperCase(c)) count++;Count capitals.
Character.isUpperCase(cp)Test a full code point.

Overloads: isUpperCase(char ch) and isUpperCase(int codePoint). To convert, use toUpperCase().

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

Parameters

ParameterDescription
ch (char)The character to test.
codePoint (int)The Unicode code point to test.

Return Value

Return ValueDescription
trueThe character is uppercase.
falseLowercase, titlecase, or caseless (digits, spaces, symbols).

Compare with Similar Methods

Related case helpers:

MethodHow it differs
isLowerCase(ch)The lowercase test; not simply the opposite.
isTitleCase(ch)For digraphs such as U+01C5.
toUpperCase(ch)Converts a single character to uppercase.

Java Examples

Example 1 — Is a Word Written in All Caps?

A word counts as all caps when it has at least one letter and none of its letters is lowercase. Digits are ignored.

Java
public class CharacterIsUpperCaseAllCaps {
    public static void main(String[] args) {
        String[] words = {"NASA", "Java", "HTTP2", "ok"};
        for (String w : words) {
            boolean anyLetter = false;
            boolean allUpper = true;
            for (char c : w.toCharArray()) {
                if (Character.isLetter(c)) {
                    anyLetter = true;
                    if (!Character.isUpperCase(c)) {
                        allUpper = false;
                    }
                }
            }
            System.out.println(w + " all caps? " + (anyLetter && allUpper));
        }
    }
}

How It Works

  1. Letters only. The inner if skips non-letters, so the 2 in "HTTP2" cannot spoil the result.
  2. One lowercase letter is enough. In "Java" the letter a fails isUpperCase and sets allUpper to false.
  3. Need at least one letter. anyLetter keeps a string such as "123" from counting as all caps.

Example 2 — Split a camelCase Name into Words

Insert a space before every uppercase letter except the first character.

Java
public class CharacterIsUpperCaseCamel {
    public static void main(String[] args) {
        String name = "parseHttpResponseCode";
        StringBuilder words = new StringBuilder();
        int count = 1;
        for (int i = 0; i < name.length(); i++) {
            char c = name.charAt(i);
            if (i > 0 && Character.isUpperCase(c)) {
                words.append(' ');
                count++;
            }
            words.append(c);
        }
        System.out.println(words + " (" + count + " words)");
    }
}

How It Works

  1. Capitals mark word starts. H, R, and C are uppercase, so a space is appended in front of each.
  2. Skip index 0. The i > 0 guard stops a leading space if the name starts with a capital, as in "ParseHttp".
  3. Count while splitting. count starts at 1 for the first word and grows with every space: 4 words.

Example 3 — Uppercase Letters in Other Scripts

Greek and accented capitals are uppercase too; a digit and a titlecase digraph are not.

Java
public class CharacterIsUpperCaseScripts {
    public static void main(String[] args) {
        char[] chars = {'\u0391', '\u03B1', '\u00C9', '9', '\u01C5'};
        for (char c : chars) {
            System.out.println((int) c + " upper=" + Character.isUpperCase(c));
        }
    }
}

How It Works

  1. Greek pair. Capital alpha (913) is uppercase and small alpha (945) is not.
  2. Accented capitals. E with acute (201) is an uppercase Latin letter, so it passes, unlike a plain c >= 'A' && c <= 'Z' check.
  3. Not uppercase. The digit 9 (57) has no case, and the titlecase digraph U+01C5 (453) belongs to its own category.

Frequently Asked Questions

No. It recognises capital letters of all cased scripts, such as Greek, Cyrillic, and accented Latin letters.
Digits have no case. They are neither uppercase nor lowercase, so both isUpperCase and isLowerCase return false.
Use !s.isEmpty() && Character.isUpperCase(s.charAt(0)), or codePointAt(0) if the text can start with a character above U+FFFF.
No. Characters such as U+01C5 have the category TITLECASE_LETTER, so isUpperCase and isLowerCase both return false; isTitleCase returns true.
No. It uses Unicode data only and ignores the default locale.

Next: isValidCodePoint()

Check that an int is a valid Unicode code point (0 to 0x10FFFF).

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

10 people found this page helpful