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

TypeScript · Type Alias

Uppercase

Uppercase<StringType> converts every character in a string type to its uppercase form. It is an intrinsic compiler type commonly used with template literal types to derive uppercase string formats.

Since
4.1

How it works

Uppercase is an intrinsic string manipulation type that transforms every character in a string type to its uppercase version. It is evaluated by the compiler and is useful inside template literal types for deriving consistently capitalized string formats.

Syntax

Uppercase<StringType>

Parameters

NameTypeDescription
StringTypestring typeThe string type whose characters should be converted to uppercase.

Returns

A string type with every character converted to its uppercase version.

Key points

  • Uppercase changes every character in the supplied string type, not only its first character.
  • For the literal "Hello, world", the resulting type is the exact literal "HELLO, WORLD".
  • Uppercase belongs to a group of four built-in casing aliases.

Common mistakes

  • Uppercase is compiler-provided rather than a user-visible declaration in the standard .d.ts files.

Example: Uppercase a string literal type

type Greeting = "Hello, world";
type ShoutyGreeting = Uppercase<Greeting>;

const greeting: ShoutyGreeting = "HELLO, WORLD";
console.log(greeting);

This compiles because Uppercase transforms every character in the literal type to its uppercase form.

When to use it

Compile-time casing

Derive uppercase labels or messages from string literal types.

Formatted cache keys

Create normalized identifiers such as ID-MY_APP from generic input.

Typed key generation

Build APIs whose string keys follow an uppercase convention.

  • Lowercase
  • Capitalize
  • Uncapitalize
  • Template Literal Types

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