Skip to content
FluidClamp
Language: English

Fluid Type Scale Generator

Build a complete modular scale whose every step is fluid. Choose a base size and a ratio for the smallest and largest screen, preview the result and copy the CSS variables.

Input unit
Output unit

Common presets

CSS variables (:root)
:root {
  --step--2: clamp(0.6944rem, 0.6593rem + 0.1759vw, 0.8rem);
  --step--1: clamp(0.8333rem, 0.7778rem + 0.2778vw, 1rem);
  --step-0: clamp(1rem, 0.9167rem + 0.4167vw, 1.25rem);
  --step-1: clamp(1.2rem, 1.0792rem + 0.6042vw, 1.5625rem);
  --step-2: clamp(1.44rem, 1.269rem + 0.8552vw, 1.9531rem);
  --step-3: clamp(1.728rem, 1.4902rem + 1.189vw, 2.4414rem);
  --step-4: clamp(2.0736rem, 1.7475rem + 1.6303vw, 3.0518rem);
  --step-5: clamp(2.4883rem, 2.0462rem + 2.2106vw, 3.8147rem);
  --step-6: clamp(2.986rem, 2.3919rem + 2.9706vw, 4.7684rem);
}
VariableAt min (px)At max (px)×
--step-647.7876.291.6
--step-539.8161.041.53
--step-433.1848.831.47
--step-327.6539.061.41
--step-223.0431.251.36
--step-119.2251.3
--step-016201.25
--step--113.33161.2
--step--211.1112.81.15

Your settings are saved in the URL, so you can bookmark or share this exact result.

Live preview

6 · 68.7pxFluid type grows smoothly with the screen.

5 · 55.4pxFluid type grows smoothly with the screen.

4 · 44.7pxFluid type grows smoothly with the screen.

3 · 36pxFluid type grows smoothly with the screen.

2 · 29.1pxFluid type grows smoothly with the screen.

1 · 23.5pxFluid type grows smoothly with the screen.

0 · 18.9pxFluid type grows smoothly with the screen.

-1 · 15.3pxFluid type grows smoothly with the screen.

-2 · 12.3pxFluid type grows smoothly with the screen.

What a modular type scale is

A modular scale multiplies a base size by the same ratio again and again: with a base of 16px and a ratio of 1.25 you get 16, 20, 25, 31.25 and so on, and dividing gives the smaller steps 12.8 and 10.24. Because every size is related by one ratio, headings, body text and captions look like they belong to the same family.

Why use two ratios

Small screens cannot fit a dramatic contrast between headings and text, while large screens look flat without it. This generator therefore takes one ratio for the minimum viewport and another for the maximum. A popular combination is a minor third (1.2) on phones and a major third (1.25) or perfect fourth (1.333) on desktops. Each step then becomes its own clamp() value that moves from the small scale to the large one as the viewport grows.

Using the exported variables

The export is a :root block with variables named --step--2 through --step-6. Assign them to elements, for example h1 to step 5, h2 to step 4, body text to step 0 and small print to step −1. Because the names describe positions on the scale rather than elements, you can retune the whole system later by changing only the base size and ratios.

Keep an eye on the largest steps: with a big ratio they can exceed the 2.5× zoom guideline from WCAG 1.4.4. The step table shows the size at both ends of the range so you can spot steps that grow too fast and lower the desktop ratio if needed.

Choosing a ratio

Lower ratios such as 1.125 or 1.2 suit dense interfaces, dashboards and documentation. Middle ratios like 1.25 and 1.333 are versatile for marketing pages and blogs. High ratios such as 1.5 or the golden ratio 1.618 create bold editorial contrast but need fewer steps to stay usable.

Frequently asked questions

How many steps do I need?

Most sites use five to seven: one or two below the base for captions and labels, the base for body text, and three or four above it for headings. The generator outputs −2 to +6 so you can delete what you do not need.

Which ratio is best for a blog?

A minor third (1.2) on mobile and a major third (1.25) or perfect fourth (1.333) on desktop gives clear headings without overwhelming the text.

Can I use these variables in Tailwind?

Yes. Use text-[length:var(--step-2)], or register them as font sizes in your Tailwind theme so you can write utilities such as text-step-2.

Why are the negative steps named --step--1?

The name is --step- followed by the step number, so step −1 becomes --step--1. It is a valid custom property name and matches the convention used by many fluid type tools.