In C#, a char (System.Char) stores one 16-bit UTF-16 code unit. You write char c = 'A'; or char d = '7';. Most everyday letters and digits fit in one char. Some symbols and emoji need two code units—a surrogate pair.
This page teaches what a C# char is. The Char Methods index lists every method guide in this series.
Working with whole text?
Use string for sentences and words. Reach for Char when you already hold one character from a loop, index, or parse.
Syntax
C# Syntax
Common ways to create and inspect characters:
C#
char c = 'A'; // letter
char d = '9'; // digit
bool ok = Char.IsDigit(d); // True
char low = Char.ToLowerInvariant(c);
string s = c.ToString(); // "A"
Reference
char vs string
The two are easy to mix up. Here is a quick comparison:
Feature
char
string
Size
One UTF-16 code unit
Zero or more chars
Literal
'A' (single quotes)
"Hello" (double quotes)
Classify
Char.IsDigit(c)
Loop chars or use string APIs
Case
Char.ToLowerInvariant(c)
s.ToLowerInvariant()
Best for
Single-character checks
Words, lines, full text
Code
C# Examples
Three short programs that show how char works with System.Char helpers.
Example 1 — Create a char and Run Common Checks
A first program that stores letters and digits, then uses Char.Is* helpers.
C#
using System;
class Program {
static void Main() {
char letter = 'A';
char digit = '7';
Console.WriteLine("letter: " + letter);
Console.WriteLine("IsLetter: " + Char.IsLetter(letter));
Console.WriteLine("IsDigit: " + Char.IsDigit(digit));
Console.WriteLine("ToLower: " + Char.ToLowerInvariant(letter));
}
}
Output
letter: A
IsLetter: True
IsDigit: True
ToLower: a
How It Works
One code unit. Each char holds a single UTF-16 value such as 'A' or '7'.
Classify.IsLetter and IsDigit answer yes/no questions about the character.
Case change.ToLowerInvariant returns a new lowercase char without changing culture surprises.
Example 2 — Keep Only Letters and Digits from Text
Loop through a string and keep characters that pass IsLetterOrDigit.
C#
using System;
class Program {
static void Main() {
string raw = "Hi, C# 12!";
string clean = "";
foreach (char c in raw) {
if (Char.IsLetterOrDigit(c)) {
clean += c;
}
}
Console.WriteLine(clean);
}
}
Output
HiC12
How It Works
Walk each char. A foreach over a string yields one char at a time.
Predicate.IsLetterOrDigit is true for letters and decimal digits.
Build result. Punctuation and spaces are skipped, so the cleaned text is HiC12.
Example 3 — Turn a One-Character String into a char
TryParse succeeds only when the string has exactly one character.
C#
using System;
class Program {
static void Main() {
string ok = "Z";
string bad = "AB";
if (Char.TryParse(ok, out char c)) {
Console.WriteLine("Parsed: " + c);
}
Console.WriteLine("TryParse AB: " + Char.TryParse(bad, out _));
}
}
Output
Parsed: Z
TryParse AB: False
How It Works
Length one."Z" has a single character, so parse succeeds.
Out variable. The parsed char lands in c for printing.
Safer than Parse. Multi-character strings return false instead of throwing.
Continue
Next: C# Char Methods Index
After you know what a char is, open the method index for a full tutorial on each System.Char API.
A char is a 16-bit UTF-16 code unit. It stores one character such as 'A', '7', or a Unicode symbol. Some emoji need two chars (a surrogate pair).
A char is one code unit. A string is a sequence of chars. Use Char methods when you already have a single character; use string methods for whole text.
IsDigit, IsLetter, IsLetterOrDigit, IsWhiteSpace, IsLower, and IsUpper are the everyday classifiers. ASCII helpers (IsAscii*) appear in .NET 7+.
Prefer ToLowerInvariant / ToUpperInvariant (or Ordinal in .NET 7+) when the result must not depend on the user culture. Plain ToLower/ToUpper follow culture rules.
Open the C# Char Methods index. It lists IsDigit, IsLetter, ToLower, Parse, surrogates, and the rest, each with examples and FAQs.