The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →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.
#1 Best Overall
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 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.
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.
Recommended Free Tools
Quick Recap
Best Value
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.




