C# Capitalize First Letter (Single Char or Every Word)
Capitalize the first letter of a string in C#, or every word for title case. Copy-paste methods using char.ToUpper and TextInfo.ToTitleCase.
To capitalize every word in C#, call TextInfo.ToTitleCase. To capitalize only the first character of a string, uppercase input[0] and keep the rest. They solve different problems, so pick the one that matches your input.
Updated: November 2026
How Do You Capitalize the First Letter of Every Word in C#?
Get a TextInfo from a CultureInfo and call ToTitleCase. This sample is complete on its own:
using System.Globalization;
var textInfo = CultureInfo.GetCultureInfo("en-GB").TextInfo;
Console.WriteLine(textInfo.ToTitleCase("the merry wives of windsor"));// The Merry Wives Of WindsorI ran this on .NET 9 and .NET 10, and both print the same result. Note that ToTitleCase is not editorial headline style. It uppercases the first letter of each word, so “war and peace” becomes “War And Peace”, not “War and Peace”. It won’t lowercase small words like “of” or “and” for you. If you need that, you have to write the rules yourself.
I use CultureInfo.GetCultureInfo("en-GB") locally here instead of assigning CultureInfo.CurrentCulture, so the rest of your app keeps its own settings. CurrentUICulture is not involved either, since it selects resources such as translated strings rather than casing rules.
What Does Culture Change?
Each CultureInfo carries a TextInfo that describes the casing behavior of that culture’s writing system. Most of the time, the culture doesn’t change the result for English text. The documented exception I know of is Dutch (nl), where .NET treats a leading “ij” as a unit and produces “IJ” (for example, “ijsselmeer” becomes “IJsselmeer”). The ToTitleCase documentation also states that the method isn’t linguistically or editorially complete.
Why Doesn’t ToTitleCase Work on ALL-CAPS Strings?
ToTitleCase leaves words that are entirely uppercase unchanged, because it treats them as acronyms. This sample is also standalone:
using System.Globalization;
var textInfo = CultureInfo.GetCultureInfo("en-GB").TextInfo;
Console.WriteLine(textInfo.ToTitleCase("HELLO WORLD"));// HELLO WORLD
Console.WriteLine(textInfo.ToTitleCase("USA and NASA"));// USA And NASALowercase First, Then Title-Case
If you want “Hello World” from shouting input, lowercase the string first with the same TextInfo:
using System.Globalization;
var textInfo = CultureInfo.GetCultureInfo("en-GB").TextInfo;
Console.WriteLine(textInfo.ToTitleCase(textInfo.ToLower("HELLO WORLD")));// Hello World
Console.WriteLine(textInfo.ToTitleCase(textInfo.ToLower("the USA and NASA")));// The Usa And NasaThis is opt-in for a reason: lowercasing first loses acronym preservation, so “USA” becomes “Usa”. I use textInfo.ToLower rather than string.ToLower so the same culture drives both steps. string.ToLower() uses CurrentCulture, which may differ from the culture you chose.
How Do You Capitalize Only the First Letter of a String in C#?
Uppercase the first character with char.ToUpper and append the rest using range syntax:
static string Capitalize(string input) => string.IsNullOrEmpty(input) ? input : char.ToUpper(input[0]) + input[1..];
Console.WriteLine(Capitalize("hello world"));// Hello worldThe empty-string guard avoids an exception on input[0]. The input[1..] range syntax needs C# 8 and a framework that supports ranges; on older targets, use input.Substring(1). char.ToUpper uses the current culture, so pass CultureInfo.InvariantCulture if you need culture-independent behavior.
One caveat: a char is a UTF-16 code unit, not a full Unicode character. For text outside the Basic Multilingual Plane (e.g., surrogate pairs) or for combined characters, this helper isn’t Unicode-general. For typical Latin-script text, it does the job.
Which One Should You Use?
Use ToTitleCase when every word in a label or heading should start with a capital, and accept that it follows simple rules rather than editorial ones. Use the first-character helper when you want a sentence-style string with only its opening letter raised. For more string essentials, see my C# cheat sheet.
Around the web
Comments
Loading comments from GitHub Discussions…