b2KIT

Fluid Typography Calculator

Calculate CSS clamp() values for fluid responsive typography between minimum and maximum viewport sizes.

Tested tool guide Tested browser tools Checked August 16, 2026

What Fluid Typography Calculator does, with a checked example

Give it four numbers - the smallest and largest font size you will accept, and the viewport widths at which each applies - and this tool returns a single CSS clamp() expression that scales the type linearly between those two viewport limits and holds it constant beyond them. The middle argument pairs a viewport-based rate with a fixed offset, which is why the output mixes units. The common surprise: this is straight-line interpolation, not easing, and the line is only as good as the four numbers you choose.

Worked example

A concrete input and expected output from the current implementation.

Input

Min font: 16px | Max font: 24px | Min viewport: 375px | Max viewport: 1440px

Expected output

clamp(16px, 0.7512vw + 0.8239rem, 24px)

The slope between the two points is (24px - 16px) / (1440px - 375px) = 8px / 1065px = 0.007512 px of font per px of viewport, written 0.7512vw. The offset is chosen so the line equals 16px at 375px: 16 - 0.007512 x 375 = 13.1831px, or 0.8239rem at 1rem = 16px. At 1440px the line reaches 0.007512 x 1440 + 13.1831 = 24.0px, and clamp() holds the min and max beyond those widths.

How the result is produced

1

Linear interpolation between two points

Draw a straight line through two points: minimum viewport with minimum size, and maximum viewport with maximum size. The slope is (maxSize - minSize) divided by (maxWidth - minWidth), expressed in vw, and a fixed offset - usually in rem - positions the line so it hits your minimum size exactly at the minimum viewport and your maximum size exactly at the maximum viewport. Between those widths the size follows the line.

2

What clamp() enforces

clamp(MIN, VAL, MAX) returns VAL when VAL falls between MIN and MAX, MIN when VAL is smaller, and MAX when VAL is larger. The vw-based middle term keeps growing or shrinking past your breakpoints, and the outer arguments cut it off there. The rem offset is calculated assuming 1rem equals 16px, the browser default root font size.

Good uses

  • Building a heading scale that resizes smoothly from phone to desktop widths without a media query per breakpoint.
  • Replacing abrupt font-size jumps in responsive CSS with a single rule that matches the design exactly at both extremes.
  • Generating the exact line to paste into a CSS custom property or design token used across a component library.

Limits and checks

  • Straight line, not easing: between the breakpoints the size is exactly proportional to viewport width. Display type often wants an accelerating curve, and a linear clamp() will feel too fast near the large end; this calculator will not bend the line.
  • The 16px rem assumption: the offset is computed at 1rem = 16px. If your CSS changes the root font size, or a user sets a custom browser default, the rem part shifts while the vw part does not, and the line drifts from your intended endpoints.
  • vw means the browser viewport, not your container: type inside a card in a multi-column layout still scales with the whole window. Container-relative fluid type needs container query units, which this calculator does not emit.

Common questions

Can I remove my media queries now?

For font-size rules, yes: clamp() handles both ends, so the two or three font-size declarations per breakpoint collapse into one. Media queries stay for layout, spacing, and everything else. And keep the viewport limits in sync with the breakpoints your layout actually uses, or the type finishes scaling before the layout reflows.

Why is the middle of clamp() a vw plus a rem instead of one unit?

No single CSS unit changes with the viewport at the exact rate your two sizes need: vw alone grows too fast or too slowly. The middle argument is the slope in vw plus an offset that anchors it, so the line passes through both of your points. Some calculators emit the offset in px (13.18px here) instead of rem; both describe the same line.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools