In C#, Char.ToUpperOrdinal returns an uppercase character using ordinal casing rules.
Available in .NET 7+. Use it for culture-agnostic uppercasing; on older targets prefer ToUpperInvariant.
This is a static member of System.Char. You call it with the type name, such as Char.ToUpperOrdinal(...) or char.ToUpperOrdinal(...). A char holds one 16-bit UTF-16 code unit.
Syntax
Pass the character (.NET 7+).
C#
char up = Char.ToUpperOrdinal('a');
Call
What it does
Char.ToUpperOrdinal(c)
Ordinal uppercase mapping.
Simple ordinal mapping without user culture.
Library declarations
C#
public static char ToUpperOrdinal(char c);
Parameters
Parameter
Description
c
Character to convert.
Return Value
Return Value
Description
char
Ordinal uppercase character.
C# Examples
Example 1 — a to A
Uppercase with ordinal mapping.
C#
using System;
class Program {
static void Main() {
Console.WriteLine(Char.ToUpperOrdinal('a'));
Console.WriteLine(Char.ToUpperOrdinal('b'));
}
}
Output
A
B
How It Works
Ordinal map. a→A, b→B.
No culture. Locale-independent.
.NET 7+. Newer API.
Latin basics. Expected English results.
Example 2 — Same on Latin
Compare ordinal and invariant upper.
C#
using System;
class Program {
static void Main() {
char c = 'm';
Console.WriteLine(Char.ToUpperOrdinal(c));
Console.WriteLine(Char.ToUpperInvariant(c));
}
}
Output
M
M
How It Works
Both M. Latin letter agrees.
Agnostic pair. Neither uses UI culture.
Stay consistent. Pick one style in a project.
Edge cases differ. Rare Unicode mappings may diverge.
Example 3 — Normalize GO
Uppercase a short token.
C#
using System;
class Program {
static void Main() {
string raw = "go";
string up = "";
foreach (char ch in raw) {
up += Char.ToUpperOrdinal(ch);
}
Console.WriteLine(up);
}
}
Output
GO
How It Works
Lower input. go.
Ordinal upper. Each character converted.
GO result. Normalized token.
Version note. Needs .NET 7+.
Frequently Asked Questions
.NET 7+.
Both avoid user culture; ordinal uses simple ordinal mapping.