Java Character toString() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Java 11 overload

Definition

In Java, Character.toString(c) returns a String of length 1 containing the char c, and boxed.toString() does the same for a Character object. Both give the same result as String.valueOf(c).

Since Java 11, Character.toString(int codePoint) accepts a full Unicode code point, so it can also build characters above U+FFFF, such as emoji. Those Strings have length 2, because they are stored as a surrogate pair.

toString exists as an instance method, boxed.toString() (Java 1.0), and as two static methods: Character.toString(char) (Java 1.4) and Character.toString(int codePoint) (Java 11). No import is needed, because java.lang is always available.

Java 11+ for the code point overload.

Character.toString(int codePoint) requires Java 11. On Java 8, write new String(Character.toChars(codePoint)), which builds the same String and also throws IllegalArgumentException for an invalid code point. The char and instance forms work on every version.

Syntax

Pick the form that matches what you have.

Java
Character boxed = 'Q';
String a = boxed.toString();               // "Q"
String b = Character.toString('Q');        // "Q"
String c = Character.toString(0x1F600);    // Java 11+: the emoji, length 2
String d = new String(Character.toChars(0x1F600));   // Java 8 equivalent
CallWhat it does
Character.toString(c)One char as a String.
boxed.toString()A Character object as a String.
Character.toString(cp)Any code point as a String (Java 11+).

toString() since Java 1.0, toString(char c) since Java 1.4, and toString(int codePoint) since Java 11.

Library declarations
Java
// java.lang.Character
public String toString()                         // Java 1.0
public static String toString(char c)            // Java 1.4
public static String toString(int codePoint)     // Java 11

Parameters

ParameterDescription
(none)Instance form: no parameters.
c (char)The char to convert.
codePoint (int)A Unicode code point, 0 to 0x10FFFF.

Return Value

Return ValueDescription
StringLength 1 for a char or BMP code point; length 2 for a supplementary code point.

Compare with Similar Methods

Other ways to make a String from a char:

MethodHow it differs
String.valueOf(c)Same result for a char.
Character.toChars(cp)Code point to char[]; wrap in new String(...) on Java 8.
Character.valueOf(c)Makes a Character object, not a String.

Java Examples

Example 1 — Convert a char and a Character to a String

Use the instance form and the static char form, then check the results.

Java
public class CharacterToStringBasic {
    public static void main(String[] args) {
        Character boxed = 'Q';
        String fromObject = boxed.toString();
        String fromChar = Character.toString('Q');
        System.out.println("instance: " + fromObject);
        System.out.println("static:   " + fromChar);
        System.out.println("same text: " + fromObject.equals(fromChar));
        System.out.println("length: " + fromChar.length());
    }
}

How It Works

  1. Instance form. boxed.toString() turns the Character object into the String "Q".
  2. Static form. Character.toString('Q') does the same from a primitive, without an object.
  3. A one-char String. Both Strings are equal and have length 1.

Example 2 — Why 'a' + 'b' Is a Number

Adding two chars produces an int. Converting the first one to a String fixes it.

Java
public class CharacterToStringConcat {
    public static void main(String[] args) {
        char first = 'a';
        char second = 'b';
        System.out.println("first + second: " + (first + second));
        String joined = Character.toString(first) + second;
        System.out.println("as text: " + joined);
        StringBuilder sb = new StringBuilder();
        for (char c : new char[] {'x', 'y', 'z'}) {
            sb.append(Character.toString(c)).append('-');
        }
        System.out.println("built: " + sb);
    }
}

How It Works

  1. Numeric addition. With two char operands, + adds their codes: 97 + 98 = 195.
  2. Start with a String. Once the left operand is "a", + means concatenation and the result is ab.
  3. Building text. Each char is turned into a String and appended with a separator, producing x-y-z-.

Example 3 — Code Points to Strings with toString(int)

This example needs Java 11 or newer. It also shows the Java 8 way and an invalid code point.

Java
public class CharacterToStringCodePoint {
    public static void main(String[] args) {
        System.out.println("toString(65): " + Character.toString(65));
        String smile = Character.toString(0x1F600);
        System.out.println("emoji length: " + smile.length());
        System.out.println("same as Java 8 way: " + smile.equals(new String(Character.toChars(0x1F600))));
        try {
            Character.toString(-1);
        } catch (IllegalArgumentException e) {
            System.out.println("-1: IllegalArgumentException");
        }
    }
}

How It Works

  1. An int means a code point. 65 is U+0041, so the result is "A"; use String.valueOf(65) if you want "65".
  2. Characters above U+FFFF. U+1F600 becomes a String of two chars (a surrogate pair), equal to the Java 8 version built with toChars.
  3. Validation. -1 is not a code point, so toString(int) throws IllegalArgumentException.

Frequently Asked Questions

Character.toString(c) or String.valueOf(c). Both return a String of length 1.
Added in Java 11, it converts a Unicode code point into a String, of length 2 for characters above U+FFFF.
Use new String(Character.toChars(codePoint)).
On Java 11+, the int overload treats 65 as code point U+0041. For the digits "65", use String.valueOf(65).
Adding two chars is numeric addition. Make one operand a String first, for example Character.toString('a') + 'b'.

Next: toTitleCase()

Convert a character to titlecase, the form used at the start of a word.

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