Java Character isBmpCodePoint() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Java 7+

Definition

In Java, Character.isBmpCodePoint(codePoint) returns true when the code point is in the Basic Multilingual Plane (BMP): 0 to 0xFFFF. Those code points fit in a single char, so (char) codePoint is a safe conversion.

The BMP holds almost all characters in everyday use, including Latin, Greek, Cyrillic, Arabic, and the common CJK characters. Code points from 0x10000 upward (most emoji, historic scripts, rare CJK) need two chars instead.

A static method of java.lang.Character (Java 7+): call it on the class, as in Character.isBmpCodePoint(...); you do not need a Character object. No import is needed, because java.lang is always available.

Syntax

Pass an int code point.

Java
Character.isBmpCodePoint('A');       // true
Character.isBmpCodePoint(0xFFFF);    // true, the last BMP code point
Character.isBmpCodePoint(0x1F600);   // false, an emoji
Character.isBmpCodePoint(-1);        // false
CallWhat it does
if (Character.isBmpCodePoint(cp)) sb.append((char) cp);Append a code point that fits in one char.
cp >>> 16 == 0The same test, usable before Java 7.
Character.isBmpCodePoint(cp) ? 1 : 2chars needed for a valid code point.

Only one overload, isBmpCodePoint(int codePoint), added in Java 7. On Java 6 write codePoint >>> 16 == 0, which is how the JDK implements it.

Library declarations
Java
// java.lang.Character (since Java 7)
public static boolean isBmpCodePoint(int codePoint)

Parameters

ParameterDescription
codePoint (int)The code point to check.

Return Value

Return ValueDescription
true0 to 0xFFFF, including the surrogate range U+D800 to U+DFFF.
falseNegative numbers and anything above 0xFFFF.

Compare with Similar Methods

The plane checks side by side:

MethodHow it differs
isSupplementaryCodePoint(cp)The other side: 0x10000 to 0x10FFFF.
isValidCodePoint(cp)The whole range, 0 to 0x10FFFF.
charCount(cp)Returns 1 or 2, but without validating the input.

Java Examples

Example 1 — Which Code Points Fit in One char?

Check a letter, the last BMP code point, the first supplementary one, an emoji, and -1.

Java
public class CharacterIsBmpCodePointTable {
    public static void main(String[] args) {
        int[] cps = {'A', 0xFFFF, 0x10000, 0x1F600, -1};
        for (int cp : cps) {
            System.out.println(cp + " bmp=" + Character.isBmpCodePoint(cp));
        }
    }
}

How It Works

  1. The BMP ends at 65535. 'A' and 0xFFFF are inside it; 0x10000 (65536) is the first code point outside.
  2. Emoji live above. U+1F600 (128512) is in plane 1, so it does not fit in one char.
  3. Negative numbers are rejected. -1 is not a code point at all, and isBmpCodePoint says false.

Example 2 — Append Code Points with or without a Surrogate Pair

Cast BMP code points to char, and use toChars for the rest.

Java
public class CharacterIsBmpCodePointAppend {
    public static void main(String[] args) {
        int[] cps = {'H', 0x1F600, '!'};
        StringBuilder sb = new StringBuilder();
        for (int cp : cps) {
            if (Character.isBmpCodePoint(cp)) {
                sb.append((char) cp);
                System.out.println(cp + ": one char");
            } else {
                sb.append(Character.toChars(cp));
                System.out.println(cp + ": surrogate pair");
            }
        }
        System.out.println("length=" + sb.length());
    }
}

How It Works

  1. A safe cast. For BMP code points, (char) cp keeps the value exactly, because it fits in 16 bits.
  2. A pair for the emoji. Character.toChars returns two chars for U+1F600, and append(char[]) adds both.
  3. Total length. One char each for H and !, two for the emoji: 4 chars.

Example 3 — isBmpCodePoint vs Two Hand-Written Checks

Compare the method with cp >>> 16 == 0 and the tempting but wrong cp <= 0xFFFF.

Java
public class CharacterIsBmpCodePointJava6 {
    public static void main(String[] args) {
        int[] cps = {0x4E2D, 0x20000, -1};
        for (int cp : cps) {
            System.out.println(cp + ": method=" + Character.isBmpCodePoint(cp)
                    + " shift=" + (cp >>> 16 == 0)
                    + " lessOrEqual=" + (cp <= 0xFFFF));
        }
    }
}

How It Works

  1. An unsigned shift. cp >>> 16 keeps only the bits above the low 16; it is 0 exactly for 0 to 0xFFFF.
  2. Agreement for real code points. U+4E2D is in the BMP and U+20000 (131072) is not; all three checks agree.
  3. The trap. For -1, >>> fills with zeros from the left and gives 0xFFFF, so shift is false, but cp <= 0xFFFF wrongly says true.

Frequently Asked Questions

Plane 0 of Unicode: code points U+0000 to U+FFFF. Every BMP code point fits in a single Java char.
Java 7. On older versions, use codePoint >>> 16 == 0.
Yes. U+D800 to U+DFFF are inside 0 to 0xFFFF, so isBmpCodePoint returns true for them.
For valid code points, yes. For invalid values such as -1 or 0x110000 both return false.
When isBmpCodePoint(cp) is true. For larger values the cast silently drops the high bits and gives a different character.

Next: isDefined()

Check whether a character is assigned a meaning in Unicode.

isDefined() 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