Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

TypeScript · Type Alias

Lowercase

Lowercase<StringType> converts every character in a string type to its lowercase equivalent. Use it to derive normalized string-literal types, including names built with template literal types.

Since
4.1

How it works

Lowercase is an intrinsic string manipulation type that transforms every character in a string type to its lowercase equivalent. It is especially useful inside template literal types when generating normalized names such as cache keys.

Syntax

Lowercase<StringType>

Parameters

NameTypeDescription
StringTypestringThe string type whose characters should be converted to lowercase.

Returns

A string type with every character converted to its lowercase equivalent.

Key points

  • Lowercase belongs to TypeScript’s built-in family of string manipulation types.
  • The transformation applies to every character rather than only the first one.
  • For a string literal input, the compiler evaluates the resulting lowercase literal type.
  • Combining a prefix with a lowercased input can produce a predictable cache-key type.

Common mistakes

  • Lowercase is compiler-provided rather than a type alias declared in the standard declaration files, so searching .d.ts files for its implementation will not find one.

Example: Lowercase a string literal type

type Greeting = "Hello, world";
type QuietGreeting = Lowercase<Greeting>;

const greeting: QuietGreeting = "hello, world";
console.log(greeting);

Transforms a string literal type into its lowercase form, allowing the compiler to check the normalized value.

When to use it

Normalize literal types

Derive lowercase variants of string literal types for compile-time validation.

Generate cache-key types

Build prefixed identifiers whose input portion must use lowercase casing.

Encode naming rules

Enforce naming conventions in generic template literal types.

Interview questions

QWhat does Lowercase do?

Lowercase<StringType> is an intrinsic string manipulation type. It converts each character in the supplied string type to its lowercase equivalent.

Follow-up: How can it be used with a generic? Define a constraint such as Str extends string, then use Lowercase<Str> inside a template literal type to construct a normalized result.

QHow does Lowercase work with template literal types?

It can be embedded in a template literal type to derive a new string literal type. For example, id-${Lowercase<"MY_APP">} produces "id-my_app".

Follow-up: Why is this useful in large codebases? It lets APIs encode naming conventions in types, so inconsistent casing becomes a compile-time error.

QHow does Lowercase differ from related casing utilities?

The type parameter represents the input string type, and the result is the same string with every character converted to lowercase. TypeScript includes it as a built-in compiler intrinsic for performance.

Follow-up: What related utilities exist? Uppercase transforms every character to uppercase, while Capitalize and Uncapitalize affect only the first character.

  • Uppercase
  • Capitalize
  • Uncapitalize
  • Template Literal Types
  • Intrinsic String Manipulation Types

Source: Documentation - Template Literal Types | TypeScript. Checked 2026-10-15.