In C#, Char.ToUpperInvariant returns the uppercase form using the invariant culture.
Use it for culture-neutral normalization—keys, protocols, and comparisons that must not follow the user locale.
This is a static member of System.Char. You call it with the type name, such as Char.ToUpperInvariant(...) or char.ToUpperInvariant(...). A char holds one 16-bit UTF-16 code unit.
Syntax
Pass the character to uppercase invariantly.
C#
char up = Char.ToUpperInvariant('a');
Call
What it does
Char.ToUpperInvariant(c)
Uppercase with invariant culture.
Does not use the current UI culture.
Library declarations
C#
public static char ToUpperInvariant(char c);
Parameters
Parameter
Description
c
Character to convert.
Return Value
Return Value
Description
char
Invariant uppercase character.
C# Examples
Example 1 — a Becomes A
Uppercase with invariant rules.
C#
using System;
class Program {
static void Main() {
Console.WriteLine(Char.ToUpperInvariant('a'));
Console.WriteLine(Char.ToUpperInvariant('z'));
}
}
Output
A
Z
How It Works
a → A. Latin mapping.
z → Z. End of alphabet.
Invariant. Locale-independent.
Key friendly. Stable for identifiers.
Example 2 — Upper a Label
Normalize each letter to upper.
C#
using System;
class Program {
static void Main() {
string label = "ok";
string up = "";
foreach (char ch in label) {
up += Char.ToUpperInvariant(ch);
}
Console.WriteLine(up);
}
}
Output
OK
How It Works
Short label. ok.
Per-char upper. Invariant mapping.
OK result. Normalized.
String helper. label.ToUpperInvariant() also works.
Example 3 — Letters Change, Digits Stay
Uppercase letters inside mixed content.
C#
using System;
class Program {
static void Main() {
string raw = "a1b";
string outText = "";
foreach (char ch in raw) {
outText += Char.ToUpperInvariant(ch);
}
Console.WriteLine(outText);
}
}
Output
A1B
How It Works
Mixed input. Letters and a digit.
Letters rise. a and b become A and B.
Digit stays. 1 unchanged.
A1B result. Predictable normalization.
Frequently Asked Questions
ToUpper uses culture; this uses invariant culture.