C# Char ConvertFromUtf32() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Char

Definition

In C#, Char.ConvertFromUtf32 takes a Unicode scalar value (UTF-32 code point) and returns a string containing the UTF-16 encoding—one char for BMP, or a surrogate pair for higher planes.

Use it when you have a numeric code point and need text.

This is a static member of System.Char. You call it with the type name, such as Char.ConvertFromUtf32(...) or char.ConvertFromUtf32(...). A char holds one 16-bit UTF-16 code unit.

Syntax

Pass an int code point; receive a string.

C#
string s = Char.ConvertFromUtf32(0x1F600);
CallWhat it does
Char.ConvertFromUtf32(0x41)Returns "A" (one char).
Char.ConvertFromUtf32(0x1F600)Returns a two-char emoji string.

Throws if the value is not a valid scalar (for example a lone surrogate code).

Library declarations
C#
public static string ConvertFromUtf32(int utf32);

Parameters

ParameterDescription
utf32Unicode code point (scalar value).

Return Value

Return ValueDescription
stringOne or two UTF-16 code units as a string.

C# Examples

Example 1 — Code Point to A

Convert 0x41 to the letter A.

C#
using System;

class Program {
    static void Main() {
        string s = Char.ConvertFromUtf32(0x41);
        Console.WriteLine(s);
        Console.WriteLine(s.Length);
    }
}

How It Works

  1. BMP value. 0x41 is Latin A.
  2. Length 1. Fits in one char.
  3. String result. Even one unit returns a string.
  4. Round trip ready. Can convert back with ConvertToUtf32.

Example 2 — Smile From Code Point

Build 😀 from U+1F600.

C#
using System;

class Program {
    static void Main() {
        string s = Char.ConvertFromUtf32(0x1F600);
        Console.WriteLine(s.Length);
        Console.WriteLine(Char.IsSurrogatePair(s, 0));
    }
}

How It Works

  1. Supplementary plane. Needs a surrogate pair.
  2. Length 2. Two UTF-16 units.
  3. Pair valid. IsSurrogatePair confirms structure.
  4. From number. Useful when codes come from data.

Example 3 — Mix BMP and Emoji

Concatenate a letter and an emoji from code points.

C#
using System;

class Program {
    static void Main() {
        string text = Char.ConvertFromUtf32(0x41) + Char.ConvertFromUtf32(0x1F600);
        Console.WriteLine("units: " + text.Length);
        Console.WriteLine("starts with A: " + (text[0] == 'A'));
    }
}

How It Works

  1. Concatenate. BMP + supplementary.
  2. Three units. A plus two surrogate chars.
  3. First is A. Index 0 is the letter.
  4. Length ≠ glyphs. Unit count is not always visible count.

Frequently Asked Questions

Supplementary characters need two chars.
ArgumentOutOfRangeException.
Yes—returns "A".
ConvertToUtf32.
Lone surrogate values are invalid scalars.

Next: ConvertToUtf32()

Convert a char or surrogate pair to a UTF-32 code point with System.Char.

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

8 people found this page helpful