C# String ToLowerOrdinal() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Not a built-in method

Definition

Short answer: C# has no String.ToLowerOrdinal() method. The name appears in some lists because “ordinal” is a common word in .NET string options (StringComparison.Ordinal, StringComparison.OrdinalIgnoreCase), but there is no lowercase method with that name.

What people usually want is one of two things. (1) A lowercase copy that is the same on every machine: use ToLowerInvariant(). (2) A comparison that ignores case without culture surprises: use StringComparison.OrdinalIgnoreCase, which does not create any new string at all.

Not a real member. System.String has no ToLowerOrdinal() method in any .NET version. Writing text.ToLowerOrdinal() does not compile; you get error CS1061 (“'string' does not contain a definition for 'ToLowerOrdinal'”). Everything on this page uses real, built-in alternatives. Whichever you pick, strings stay immutable: you get a new string or a bool, and the original text never changes.

Syntax

No built-in method — use these instead. Each line below compiles and runs.

C#
string text = "ABC-Def";

// text.ToLowerOrdinal();   // error CS1061: no such method

string lower = text.ToLowerInvariant();                                       // "abc-def"
bool same = string.Equals(text, "abc-def", StringComparison.OrdinalIgnoreCase); // True
char c = char.ToLowerInvariant('Q');                                           // 'q'
Use this insteadWhen to use it
text.ToLowerInvariant()You need a lowercase copy that is identical on every computer.
string.Equals(a, b, StringComparison.OrdinalIgnoreCase)You need to compare two strings and ignore case.
text.EndsWith(".pdf", StringComparison.OrdinalIgnoreCase)You need a case-insensitive prefix, suffix, or search check.
char.ToLowerInvariant(c)You lowercase one character at a time.

“Ordinal” in .NET means “compare by character code numbers”. OrdinalIgnoreCase compares codes after folding letters to one case using invariant rules. In .NET 8 and later, System.Text.Ascii also offers span-based lowercase helpers for pure ASCII data, but for everyday code ToLowerInvariant() is the simple choice.

Real declarations of the alternatives
C#
// System.String
public string ToLowerInvariant();
public string ToLower(CultureInfo? culture);
public static bool Equals(string? a, string? b, StringComparison comparisonType);

// System.Char
public static char ToLowerInvariant(char c);

Parameters

ParameterDescription
NoneThere is no ToLowerOrdinal(), so there are no parameters. ToLowerInvariant() also takes none.
comparisonTypeFor string.Equals, StartsWith, EndsWith, and IndexOf: pass StringComparison.OrdinalIgnoreCase.

Return Value

Return ValueDescription
string (ToLowerInvariant)A new lowercase copy using invariant rules.
bool (Equals with OrdinalIgnoreCase)Whether the two strings match when case is ignored. No new strings are created.

C# Examples

Example 1 — The Real Way to Get a Culture-Safe Lowercase Copy

Use ToLowerInvariant() where you might have expected a ToLowerOrdinal().

C#
using System;

class Program {
    static void Main() {
        string code = "ABC-Def";

        string lower = code.ToLowerInvariant();
        Console.WriteLine(lower);
        Console.WriteLine(code);
    }
}

How It Works

  1. The missing method. code.ToLowerOrdinal() would not compile, so this program uses the closest real method.
  2. Fixed lowercase rules. ToLowerInvariant() lowers every letter using the invariant culture; the dash is kept.
  3. Identical everywhere. The output does not depend on the computer's language, which is usually what “ordinal” is meant to suggest.
  4. A new string. code still prints ABC-Def.

Example 2 — Compare Without Case, No Copy Needed

If you wanted to lowercase only to compare, skip the copy and pass OrdinalIgnoreCase.

C#
using System;

class Program {
    static void Main() {
        string file = "Report.PDF";

        Console.WriteLine(file.Equals("report.pdf"));
        Console.WriteLine(string.Equals(file, "report.pdf", StringComparison.OrdinalIgnoreCase));
        Console.WriteLine(file.EndsWith(".pdf", StringComparison.OrdinalIgnoreCase));
    }
}

How It Works

  1. Exact by default. Equals without options compares every character code, so the capital letters make it False.
  2. Ordinal, ignoring case. The static string.Equals with OrdinalIgnoreCase treats R/r and PDF/pdf as equal.
  3. Works for suffixes too. EndsWith accepts the same option, so a file-type check needs no lowercase copy.
  4. Cheaper than lowercasing. No temporary strings are created, which matters inside big loops.

Example 3 — Lowercase Character by Character

Lower each char yourself with char.ToLowerInvariant and confirm it matches the string method.

C#
using System;

class Program {
    static void Main() {
        string s = "MiXeD";
        char[] chars = s.ToCharArray();

        for (int i = 0; i < chars.Length; i++) {
            chars[i] = char.ToLowerInvariant(chars[i]);
        }

        string result = new string(chars);
        Console.WriteLine(result);
        Console.WriteLine(result == s.ToLowerInvariant());
    }
}

How It Works

  1. Copy to an array. A string cannot be edited, but the char[] from ToCharArray() can.
  2. One letter at a time. char.ToLowerInvariant is a real static method on System.Char that lowers a single character with invariant rules.
  3. Back to a string. new string(chars) builds mixed from the edited array.
  4. Same as the built-in. The comparison prints True, so for whole strings simply call ToLowerInvariant(). The loop is useful when you only lower some characters.

Frequently Asked Questions

No. There is no ToLowerOrdinal method on System.String in any .NET version, and calling it gives compiler error CS1061. Use ToLowerInvariant() for a lowercase copy, or StringComparison.OrdinalIgnoreCase for case-insensitive comparisons.
For a lowercase copy that is the same on every machine, use text.ToLowerInvariant(). To compare without case, use string.Equals(a, b, StringComparison.OrdinalIgnoreCase).
Ordinal means characters are compared by their numeric UTF-16 codes, without culture rules. StringComparison.Ordinal is exact; OrdinalIgnoreCase also ignores letter case.
It does not create new strings, it is fast, and it gives the same answer on every machine. a.ToLower() == b.ToLower() can fail under some cultures, such as Turkish.
You can write an extension method with that name, but it would be your own code, not part of .NET. Usually it would just call ToLowerInvariant(), so it is simpler to call that directly.

Next: ToString()

Get the string itself back; it returns the very same instance, with no copy.

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

12 people found this page helpful