C# Convert ToChar() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Convert

Definition

In C#, Convert.ToChar returns a char—one UTF-16 code unit.

A string argument must be exactly one character long. Numeric overloads map integer codes to characters. Empty or longer strings throw.

This is a static member of System.Convert. You call it with the type name, such as Convert.ToChar(...). Convert is the everyday API for converting between common CLR types in C#.

Syntax

Pass a one-character string or a character code.

C#
char a = Convert.ToChar("A");
char b = Convert.ToChar(65);
char c = Convert.ToChar('Z');
CallWhat it does
Convert.ToChar("A")Single-character string → char.
Convert.ToChar(65)Code point 65 → 'A'.
Convert.ToChar('Z')Already a char (identity).

Strings longer than one character throw FormatException. null throws for string overload.

Library declarations
C#
public static char ToChar(string value);
public static char ToChar(int value);
public static char ToChar(object? value);

Parameters

ParameterDescription
valueRequired. One-character string, integer code, or convertible object.

Return Value

Return ValueDescription
charThe resulting character.

C# Examples

Example 1 — One Letter String

Convert a single-character string to char.

C#
using System;

class Program {
    static void Main() {
        char ch = Convert.ToChar("Q");
        Console.WriteLine(ch);
        Console.WriteLine((int)ch);
    }
}

How It Works

  1. One character. "Q" is valid length for ToChar.
  2. Print letter. Console shows Q.
  3. Cast to int. Shows the Unicode code 81.
  4. Length rule. Longer strings would throw instead.

Example 2 — Integer Code to Char

Build a letter from its numeric code.

C#
using System;

class Program {
    static void Main() {
        char a = Convert.ToChar(65);
        char b = Convert.ToChar(66);
        Console.WriteLine(a.ToString() + b);
    }
}

How It Works

  1. 65 is A. Classic ASCII/Unicode mapping.
  2. 66 is B. Next code yields the next letter.
  3. Concatenate. Two chars join into the string AB.
  4. Range check. Codes outside char limits throw OverflowException.

Example 3 — Turn Digit Text into Char

Keep a digit as a character, not as an int.

C#
using System;

class Program {
    static void Main() {
        char d = Convert.ToChar("7");
        Console.WriteLine(d);
        Console.WriteLine(char.IsDigit(d));
    }
}

How It Works

  1. Still a char. "7" becomes the character '7', not integer 7.
  2. IsDigit. Confirms the result is a decimal digit character.
  3. Different from ToInt32. ToInt32("7") would return int 7.
  4. Pick the API. Use ToChar when you need a character value.

Frequently Asked Questions

No. The string must be exactly one character.
The character 'A'.
No. The string overload throws on null.
Similar for numeric codes; ToChar also handles string/object overloads.
Cast: (int)ch, or use Convert.ToInt32(ch).

Next: ToDateTime()

Convert a string or object to DateTime using culture rules with System.Convert.

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