Java Character lowSurrogate() Method

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

Definition

In Java, Character.lowSurrogate(codePoint) returns the low surrogate: the second of the two chars that encode a supplementary code point. For U+1F600 it returns '\uDE00'.

The low surrogate carries the lowest 10 bits of the code point, added to 0xDC00. Because subtracting 0x10000 does not change those bits, you can compute it as 0xDC00 + (codePoint & 0x3FF).

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

Syntax

Pass a supplementary code point.

Java
char a = Character.lowSurrogate(0x1F600);   // '\uDE00'
char b = Character.lowSurrogate(0x10000);   // '\uDC00'
char c = Character.lowSurrogate(0x10FFFF);  // '\uDFFF'
// Character.lowSurrogate('A')              // unspecified result, do not do this
CallWhat it does
Character.lowSurrogate(cp)Second char of the pair.
(char) (0xDC00 + (cp & 0x3FF))The same calculation by hand.
Character.toCodePoint(Character.highSurrogate(cp), Character.lowSurrogate(cp))Round trip back to cp.

One overload, lowSurrogate(int codePoint), added in Java 7. On Java 5 and 6, Character.toChars(cp)[1] gives the same char for supplementary code points.

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

Parameters

ParameterDescription
codePoint (int)A supplementary code point.

Return Value

Return ValueDescription
charA low surrogate from 0xDC00 to 0xDFFF when the input is supplementary.

Compare with Similar Methods

Related methods:

MethodHow it differs
highSurrogate(cp)The first half (Java 7+).
isLowSurrogate(ch)Tests whether a char is a low surrogate.
toChars(cp)Both halves in one array (Java 5+).

Java Examples

Example 1 — Low Surrogates for Four Supplementary Code Points

Print the low surrogate in hex for the edges of the range and two emoji.

Java
public class CharacterLowSurrogateValues {
    public static void main(String[] args) {
        int[] cps = {0x10000, 0x1F600, 0x1F44D, 0x10FFFF};
        for (int cp : cps) {
            System.out.println("U+" + Integer.toHexString(cp) + " low=0x"
                    + Integer.toHexString(Character.lowSurrogate(cp)));
        }
    }
}

How It Works

  1. The range ends. U+10000 has all low bits clear and gives 0xDC00; U+10FFFF has all low bits set and gives 0xDFFF.
  2. The last 10 bits. 0x1F600 ends in the bits 0x200, so its low surrogate is 0xDC00 + 0x200 = 0xDE00; 0x1F44D ends in 0x04D, giving 0xDC4D.
  3. No glyphs printed. Converting each char with Integer.toHexString keeps the output to plain hex digits.

Example 2 — Consecutive Code Points Share a High Surrogate

Four emoji in a row differ only in their low surrogate.

Java
public class CharacterLowSurrogateRun {
    public static void main(String[] args) {
        for (int cp = 0x1F600; cp <= 0x1F603; cp++) {
            System.out.println("0x" + Integer.toHexString(cp)
                    + " -> 0x" + Integer.toHexString(Character.highSurrogate(cp))
                    + " 0x" + Integer.toHexString(Character.lowSurrogate(cp)));
        }
    }
}

How It Works

  1. A loop over code points. cp runs from U+1F600 to U+1F603, four emoji faces in a row.
  2. Same first half. All four have the same upper bits, so highSurrogate stays at 0xD83D.
  3. The low half counts up. Adding 1 to the code point adds 1 to the low surrogate, from 0xDE00 to 0xDE03.

Example 3 — Split into Surrogates and Join Back Again

Check that toCodePoint(highSurrogate(cp), lowSurrogate(cp)) returns the original code point, and compare with the hand-written formula.

Java
public class CharacterLowSurrogateRoundTrip {
    public static void main(String[] args) {
        int[] cps = {0x10000, 0x1D11E, 0x1F680, 0x10FFFF};
        int ok = 0;
        for (int cp : cps) {
            char low = Character.lowSurrogate(cp);
            boolean formula = low == (char) (0xDC00 + (cp & 0x3FF));
            boolean back = Character.toCodePoint(Character.highSurrogate(cp), low) == cp;
            if (formula && back) ok++;
        }
        System.out.println(ok + " of " + cps.length + " code points round-trip correctly");
    }
}

How It Works

  1. Masking the low bits. cp & 0x3FF keeps the lowest 10 bits; adding 0xDC00 gives the low surrogate, matching the method every time.
  2. Decoding again. toCodePoint combines the two halves back into one int, which equals the starting value.
  3. Edge cases included. The test covers the first and last supplementary code points as well as two in the middle.

Frequently Asked Questions

Java 7. On older versions use Character.toChars(cp)[1] for supplementary code points.
It is 0xDC00 plus the lowest 10 bits of the code point: (char) (0xDC00 + (cp & 0x3FF)).
The result is unspecified. BMP code points are stored as a single char and have no surrogates.
No. It never validates its argument, so check isSupplementaryCodePoint yourself.
Character.toCodePoint(high, low), ideally after checking Character.isSurrogatePair(high, low).

Next: offsetByCodePoints()

Move an index forward or backward by a number of code points.

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

13 people found this page helpful