Type Scale Generator

A type scale gives every heading and text size a fixed relationship: each step is the one below it multiplied by a ratio. Choose your body size and a ratio, preview every step with your own text, and copy the sizes as CSS variables or Tailwind. Turn on fluid mode to have the whole scale grow smoothly from phones to desktops with clamp().

px

Each size becomes a clamp() value

5xl

61.04px

The quick brown fox

4xl

48.83px

The quick brown fox

3xl

39.06px

The quick brown fox

2xl

31.25px

The quick brown fox

xl

25px

The quick brown fox

lg

20px

The quick brown fox

base

16px

The quick brown fox

sm

12.8px

The quick brown fox

xs

10.24px

The quick brown fox

Code
:root {
  --font-size-5xl: 3.8147rem;
  --font-size-4xl: 3.0518rem;
  --font-size-3xl: 2.4414rem;
  --font-size-2xl: 1.9531rem;
  --font-size-xl: 1.5625rem;
  --font-size-lg: 1.25rem;
  --font-size-base: 1rem;
  --font-size-sm: 0.8rem;
  --font-size-xs: 0.64rem;
}

Calculating runs in your browser. What you type never leaves this device.

Features

  • Eight classic ratios from minor second (1.067) to golden ratio (1.618)

  • Up to nine steps up and four steps down, named like Tailwind: sm, base, lg, xl, 2xl...

  • Fluid mode: a different base and ratio on phones and desktops, joined with clamp()

  • Preview with your own text in sans, serif or mono

  • Export as CSS variables, Tailwind v4 @theme or a Tailwind v3 fontSize config

Why use a type scale

Consistent headings

H1 to H6 that look related instead of picked at random.

Design systems

A small set of named sizes that designers and developers share.

Responsive sites

Big, bold headings on desktops that shrink gracefully on phones, without media queries.

Choosing a scale

Which ratio?

  • Small ratios (1.067 to 1.2) suit dense apps, dashboards and long documents: headings stay modest.
  • Medium ratios (1.25 to 1.333) suit most websites and blogs.
  • Large ratios (1.414 to 1.618) suit landing pages and editorial designs with dramatic headlines.

Fixed or fluid

A fixed scale uses the same sizes on every screen. A fluid scale uses a smaller base and ratio on phones and a larger one on desktops; each step becomes a clamp() that grows with the screen width between the two widths you set. A common choice is 16 px with 1.2 on phones and 18 px with 1.333 on desktops.

Sizes are in rem

All sizes are written in rem (1rem = 16 px by default) so text grows when a reader increases their browser's font size, which accessibility guidelines require.

Related tools

Type Scale Generator - FAQ