C# Char ToUpperOrdinal() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Char

Definition

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');
CallWhat it does
Char.ToUpperOrdinal(c)Ordinal uppercase mapping.

Simple ordinal mapping without user culture.

Library declarations
C#
public static char ToUpperOrdinal(char c);

Parameters

ParameterDescription
cCharacter to convert.

Return Value

Return ValueDescription
charOrdinal 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'));
    }
}

How It Works

  1. Ordinal map. a→A, b→B.
  2. No culture. Locale-independent.
  3. .NET 7+. Newer API.
  4. 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));
    }
}

How It Works

  1. Both M. Latin letter agrees.
  2. Agnostic pair. Neither uses UI culture.
  3. Stay consistent. Pick one style in a project.
  4. 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);
    }
}

How It Works

  1. Lower input. go.
  2. Ordinal upper. Each character converted.
  3. GO result. Normalized token.
  4. Version note. Needs .NET 7+.

Frequently Asked Questions

.NET 7+.
Both avoid user culture; ordinal uses simple ordinal mapping.
ToUpper is culture-sensitive.
ToUpperInvariant.
Yes.

Next: TryParse()

Try to convert a length-1 string to a char without throwing with System.Char.

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

11 people found this page helpful