Start a project

Tool 61 of 244 · Typography

Fluid Type Scale

Make headings and spacing grow smoothly from a phone to a big screen with CSS clamp(), so you can stop writing breakpoints just to change font sizes.

Fluid Type Scale at a glanceIllustration: 1, Sizes and ratios; 2, processed in your browser; 3, clamp() type scale.Fluid Type Scale16px = 1rem1Sizes and ratiosAaaa3clamp() type scale2In yourbrowser
1 Sizes and ratios 2 processed on your device 3 clamp() type scale

Fluid Type Scale

Settings

1rem in your CSS, usually 16

Preview

Space scale

Your scale

StepSmallest screenLargest screen
CSS custom properties

Use them like h1 { font-size: var(--step-4); } and .stack > * + * { margin-top: var(--space-m); }.

01

What it does

CSS clamp() type and spacing scales that grow smoothly from phone to desktop, with a live preview at any width.

  • Type scale from two sizes and two ratios
  • Space scale with one-up pairs
  • Live preview at any screen width
  • WCAG 1.4.4 zoom warning

02

Private by design

Everything happens in your browser. Nothing you type, paste or upload is sent anywhere, and it keeps working offline once the page has loaded.

03

What you get

CSS custom properties, with a Copy and a Download button on every result.

  • CSS clamp()
  • Custom properties
  • Modular scale

Why it matters

Most sites set font sizes at two or three breakpoints, so headings jump in size as you resize the window and look too big or too small in between. A fluid scale sets a size for the smallest and largest screens and lets CSS work out everything in between with clamp(), which every current browser supports.

Using a modular scale (each step a fixed ratio bigger than the last) keeps headings in proportion, and a matching space scale means padding and gaps grow with the text. The result is a layout that feels designed at every width, with less CSS than a stack of media queries.

How it works

  1. InputMin/max font size, viewport widths and ratios
  2. In your browserEach step scaled and turned into a linear clamp()
  3. OutputCSS custom properties for type and spacing

Where it fits in a designer's workflow

  1. Plan
  2. Design
  3. Build
  4. Test
  5. Launch
Set it once at the start of a build so headings scale smoothly everywhere.

By the numbers

Font size per step at a 360px and a 1240px viewportstep -2: 11.11px to 12.8px; step -1: 13.33px to 16.0px; step 0: 16.0px to 20.0px; step 1: 19.2px to 25.0px; step 2: 23.04px to 31.25px; step 3: 27.65px to 39.06px; step 4: 33.18px to 48.83px; step 5: 39.81px to 61.04pxstep -2step -1step 0step 1step 2step 3step 4step 5
  • 16px × 1.2 at 360px
  • 20px × 1.25 at 1240px
Example scale, computed: each step multiplies the one below by the ratio, and the tool writes a CSS clamp() that slides between the two sizes as the screen widens. Bigger ratios spread the headings further apart on large screens.
Show the numbers as a table
StepAt 360pxAt 1240px
step -211.11px12.8px
step -113.33px16.0px
step 016.0px20.0px
step 119.2px25.0px
step 223.04px31.25px
step 327.65px39.06px
step 433.18px48.83px
step 539.81px61.04px

How to use it

  1. Set your body text size for the smallest and largest screens, and the screen widths they apply at.
  2. Pick a scale ratio for each end. A smaller ratio on phones stops headings getting too big.
  3. Drag the screen width slider to see every step at that width.
  4. Copy or download the CSS, then use var(--step-0) for body text and higher steps for headings.

FAQ

Why use rem in the clamp()?

The rem parts respect the reader's browser font-size setting, so text still gets bigger when someone has chosen larger text. The vw part is what makes it fluid.

What is the 2.5× warning?

WCAG 1.4.4 asks that text can be zoomed to 200%. If a size grows more than 2.5 times across the range, zooming can stop making it bigger, so the tool warns you.

Does it work with Tailwind?

Yes. Paste the variables into your CSS and reference them in your theme, for example fontSize: { h1: 'var(--step-4)' }.

Which ratios work best?

1.2 on phones and 1.25 to 1.333 on desktop suit most sites. Bigger ratios make dramatic headlines but need more room.

Work with me

Want a site that gets these right?

I build fast, accessible websites and web apps that pass these checks from day one. Tell me about your project and I'll reply personally with honest next steps.

All developer tools · Back to leej.uk