October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk1 min

Convert a String to Lowercase in TypeScript

Convert runtime text with toLowerCase(); use Lowercase for compile-time string literal types and locale-aware methods when language rules matter.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Call toLowerCase() on a runtime string: const lowercase = value.toLowerCase();. It returns a new string and leaves the original unchanged. Use TypeScript’s Lowercase<T> type instead only when you want to transform a string literal type at compile time.

Lowercase a runtime string with toLowerCase()

toLowerCase() is a built-in JavaScript string method available in TypeScript. Call it on the string value you want to convert:

const input: string = "Hello, TypeScript!";
const lowercase = input.toLowerCase();

console.log(lowercase); // "hello, typescript!"
console.log(input);     // "Hello, TypeScript!"

The method returns a new string; it does not mutate the original. This is a runtime operation, so it runs when the program executes.

How Lowercase<T> differs

TypeScript also provides the intrinsic Lowercase<T> type. It transforms string literal types during type checking; it does not convert a variable’s runtime value.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const runtimeValue = "HELLO".toLowerCase(); // runtime string: "hello"
type LiteralResult = Lowercase<"HELLO">;   // compile-time type: "hello"

Use Lowercase<T> when defining types—for example, as part of a template-literal type—and toLowerCase() when changing text your program handles. The TypeScript Handbook explains that intrinsic string manipulation types use JavaScript’s string runtime functions and are not locale-aware.

When language-specific casing matters

For text that should follow a particular language’s casing rules, use toLocaleLowerCase() and specify the intended locale when it is known:

Rank #2
TypeScript Programming Language - Software Engineer & Coder T-Shirt
  • TypeScript implements a superset of syntax for strictly typed development, facilitating deep static analysis and enhanced development environment integration. The compiler translates source into standard script formats, ensuring parity across any runtime.
  • TypeScript is ideal for front-end developers, full-stack engineers, and software architects who build large-scale web applications. It serves those looking to improve code excellence, reduce bugs through static checking, and maintain complex projects more.
  • Lightweight, Classic fit, Double-needle sleeve and bottom hem
const city = "İstanbul";
const lowercaseCity = city.toLocaleLowerCase("tr"); // "istanbul"

The result can differ from default toLowerCase() for some locales, including Turkish. toLocaleLowerCase() also returns a new string. Choose the locale deliberately when the text is meant to follow language-specific rules. See MDN’s toLocaleLowerCase() reference.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

If your goal is case-insensitive comparison

Lowercasing both strings before comparing them can be convenient, but it is not a universal definition of linguistic equality. When comparison should respect a locale, consider Intl.Collator or localeCompare() with an appropriate sensitivity option. The right choice depends on the language and the comparison behavior your application needs. MDN describes these options in its string case-conversion guidance.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.