Fluid Typography Scale Calculator with CSS clamp()

Configure your mobile and desktop type scales and active steps. Preview the live result (as a live scale, side-by-side comparison, graph, or article specimen) and copy the ready-to-use CSS below.

Zur deutschen Version
A small Aa above a phone, a large Aa above a monitor, and a line below that rises between them

Mobile 16 px × 1.125 @ 320 px → Desktop 18 px × 1.2 @ 1200 px

DEEN

Preview

--fs-displayDisplay · Step 7
36.5 px→50.7 px (3.172rem)→64.5 px

Clear typography builds trust

--fs-h1H1 · Step 6
32.4 px→43.3 px (2.705rem)→53.7 px

Clear typography builds trust

--fs-h2H2 · Step 5
28.8 px→37.0 px (2.31rem)→44.8 px

Clear typography builds trust

--fs-h3H3 · Step 4
25.6 px→31.6 px (1.974rem)→37.3 px

Clear typography builds trust

--fs-h4H4 · Step 3
22.8 px→27.0 px (1.689rem)→31.1 px

Clear typography builds trust

--fs-h5H5 · Step 2
20.3 px→23.1 px (1.446rem)→25.9 px

Clear typography builds trust

--fs-h6H6 · Step 1
18.0 px→19.8 px (1.24rem)→21.6 px

Clear typography builds trust

--fs-pBody (p) · Step 0
16.0 px→17.0 px (1.064rem)→18.0 px

Clear typography builds trust

--fs-smallSmall · Step -1
13.9 px→14.8 px (0.925rem)→15.7 px

Clear typography builds trust

Generated CSS & Tokens

What is CSS :root used for? Defines your fluid type scale as CSS custom properties on :root. Paste it at the top of your stylesheet and reference var(--fs-h1) through var(--fs-small).
CSS
/* Fluid Type Scale: mobile 16px × 1.125 @ 320px -> desktop 18px × 1.2 @ 1200px */
:root {
  /* Step -1: 13.9px → 15.7px */
  --fs-small: clamp(0.87rem, 0.83rem + 0.198vw, 0.978rem);
  /* Step 0: 16.0px → 18.0px */
  --fs-p: clamp(1rem, 0.955rem + 0.227vw, 1.125rem);
  /* Step 1: 18.0px → 21.6px */
  --fs-h6: clamp(1.125rem, 1.043rem + 0.409vw, 1.35rem);
  /* Step 2: 20.3px → 25.9px */
  --fs-h5: clamp(1.266rem, 1.137rem + 0.644vw, 1.62rem);
  /* Step 3: 22.8px → 31.1px */
  --fs-h4: clamp(1.424rem, 1.235rem + 0.946vw, 1.944rem);
  /* Step 4: 25.6px → 37.3px */
  --fs-h3: clamp(1.602rem, 1.336rem + 1.329vw, 2.333rem);
  /* Step 5: 28.8px → 44.8px */
  --fs-h2: clamp(1.802rem, 1.439rem + 1.813vw, 2.799rem);
  /* Step 6: 32.4px → 53.7px */
  --fs-h1: clamp(2.027rem, 1.543rem + 2.422vw, 3.359rem);
  /* Step 7: 36.5px → 64.5px */
  --fs-display: clamp(2.281rem, 1.644rem + 3.183vw, 4.031rem);
}

Why two scales?

On a 375 px phone, a steep ratio like 1.25 makes an H1 wrap after two words. A gentle ratio like 1.125 solves that on the phone. On a wide monitor, though, headings and body text then look almost the same size, and the page feels flat. That’s why you set a separate ratio for each end: gentle steps on the phone and clear ones on the desktop.

Why clamp()?

With media queries, eight font sizes at three breakpoints would need 24 separate CSS rules. On top of that, text jumps from one size to the next at every breakpoint. clamp() instead sets a minimum and a maximum size for each step. In between, text grows smoothly with the screen width, so nothing jumps on tablets or small laptops.

Why rem and vw?

A font size set only in vw depends on the screen width alone. That’s why it stays the same size when someone zooms in or raises the default font size. As a result, it fails WCAG success criterion 1.4.4. The calculator therefore combines a fixed part in rem with a growing part in vw (or cqi). The rem part follows the browser’s text settings, so your headings grow with them.

Which export for what?

“CSS :root” gives you the font sizes as custom properties such as --fs-h1. You paste the block at the top of your stylesheet and use the properties anywhere. “CSS + Classes” adds classes such as .fs-h3, so an h2 can look smaller without changing the heading order. “GenerateBlocks JSON” holds the same values as JSON for GenerateBlocks Pro or your own build scripts.