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
Mobile 16 px × 1.125 @ 320 px → Desktop 18 px × 1.2 @ 1200 px
Preview
Clear typography builds trust
Clear typography builds trust
Clear typography builds trust
Clear typography builds trust
Clear typography builds trust
Clear typography builds trust
Clear typography builds trust
Clear typography builds trust
Clear typography builds trust
/* 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.