Java Character isUnicodeIdentifierStart() Method

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

Definition

In Java, Character.isUnicodeIdentifierStart(ch) returns true when the character may begin an identifier according to the Unicode identifier rules (Unicode Standard Annex #31), rather than the Java language rules. That means letters and letter numbers such as Roman numerals.

The key difference from isJavaIdentifierStart() is that '$' and '_' are not allowed at the start. Use it when validating names for a format or language that follows Unicode rules instead of Java's.

A static method of java.lang.Character (Java 1.1+): call it on the class, as in Character.isUnicodeIdentifierStart(...); 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.isUnicodeIdentifierStart('a');      // true
Character.isUnicodeIdentifierStart('_');      // false (isJavaIdentifierStart: true)
Character.isUnicodeIdentifierStart('$');      // false (isJavaIdentifierStart: true)
Character.isUnicodeIdentifierStart('\u2160'); // true, ROMAN NUMERAL ONE
Character.isUnicodeIdentifierStart(0x10400);  // true, DESERET CAPITAL LETTER LONG I
CallWhat it does
Character.isUnicodeIdentifierStart(key.charAt(0))Does this key start like a Unicode identifier?
Character.isUnicodeIdentifierStart(key.codePointAt(0))Same, for a first character above U+FFFF.
Character.isJavaIdentifierStart(c) && !Character.isUnicodeIdentifierStart(c)Chars only Java allows at the start.

Two overloads: isUnicodeIdentifierStart(char ch) since Java 1.1 and isUnicodeIdentifierStart(int codePoint) since Java 5.

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

Parameters

ParameterDescription
ch (char)The character to test.
codePoint (int)A Unicode code point; invalid values return false.

Return Value

Return ValueDescription
trueA letter or letter number (newer JDKs also include the few Other_ID_Start characters).
falseDigits, '$', '_', punctuation, symbols.

Compare with Similar Methods

Unicode rules vs Java rules:

MethodHow it differs
isJavaIdentifierStart(ch)Also allows '$', '_', and other currency or connector chars.
isUnicodeIdentifierPart(ch)The rule for later positions.
isLetter(ch)Letters only, without letter numbers.

Java Examples

Example 1 — Unicode and Java Rules Side by Side

Test five characters with both start methods.

Java
public class CharacterIsUnicodeIdentifierStartTable {
    static String show(char c) {
        return (c >= 32 && c < 127) ? "'" + c + "'" : "0x" + Integer.toHexString(c);
    }

    public static void main(String[] args) {
        char[] chars = {'a', '_', '$', '7', '\u2160'};
        for (char c : chars) {
            System.out.println(show(c) + " unicode=" + Character.isUnicodeIdentifierStart(c)
                    + " java=" + Character.isJavaIdentifierStart(c));
        }
    }
}

How It Works

  1. Where the rules differ. '_' and '$' are fine first characters in Java but not under the Unicode rules.
  2. Where they agree. Both reject the digit '7' and both accept the letter 'a'.
  3. A letter number. U+2160 ROMAN NUMERAL ONE is in the "letter number" category, which both rule sets allow at the start.

Example 2 — Validate Keys with Unicode Identifier Rules

Check configuration keys: the first char must pass isUnicodeIdentifierStart, the rest isUnicodeIdentifierPart.

Java
public class CharacterIsUnicodeIdentifierStartKeys {
    static boolean validKey(String s) {
        if (s.isEmpty() || !Character.isUnicodeIdentifierStart(s.charAt(0))) return false;
        for (int i = 1; i < s.length(); i++) {
            if (!Character.isUnicodeIdentifierPart(s.charAt(i))) return false;
        }
        return true;
    }

    public static void main(String[] args) {
        String[] keys = {"name", "_name", "$name", "user_id", "user-id", "1x"};
        for (String k : keys) {
            System.out.println(k + " -> " + validKey(k));
        }
    }
}

How It Works

  1. Underscore inside is fine. user_id is valid because '_' is allowed in later positions, just not first.
  2. Rejected starts. _name, $name, and 1x all fail on the first character.
  3. Rejected parts. user-id starts well, but '-' is never part of an identifier.

Example 3 — Start Characters Outside the BMP

Use the int overload for a math letter, a Deseret letter, an emoji, and a math digit.

Java
public class CharacterIsUnicodeIdentifierStartCodePoints {
    public static void main(String[] args) {
        int[] cps = {0x1D400, 0x10400, 0x1F600, 0x1D7CE};
        for (int cp : cps) {
            System.out.println("0x" + Integer.toHexString(cp)
                    + " start=" + Character.isUnicodeIdentifierStart(cp)
                    + " part=" + Character.isUnicodeIdentifierPart(cp));
        }
    }
}

How It Works

  1. Two supplementary letters. MATHEMATICAL BOLD CAPITAL A and DESERET CAPITAL LETTER LONG I are uppercase letters, valid in any position.
  2. A digit outside the BMP. U+1D7CE MATHEMATICAL BOLD DIGIT ZERO is a decimal digit: not a start, but a valid part.
  3. No emoji. U+1F600 is a symbol, so it fails both checks.

Frequently Asked Questions

An identifier defined by Unicode Standard Annex #31: it starts with a letter or letter number and continues with letters, digits, connectors, and marks.
isJavaIdentifierStart also allows currency symbols such as $ and connector punctuation such as _ at the start; isUnicodeIdentifierStart does not.
Not under these rules. Character.isUnicodeIdentifierStart('_') is false.
For rare characters, yes: newer JDKs add Other_ID_Start chars and newer Unicode letters. ASCII results are stable.
When validating names for a system that follows Unicode identifier rules rather than Java rules, such as some query or markup languages.

Next: isUpperCase()

Check whether a character is uppercase, such as A to Z.

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

9 people found this page helpful