Skip to content

CSS Clamp Generator for Fluid Typography

CSS clamp generator calculates a fluid typography scale between minimum and maximum viewport widths. Set font-size endpoints, root size, a ratio and the number of scale steps.

Found a problem, or something that could be better? We read every message and we fix things quickly.

CSS clamp generator calculates a fluid typography scale between minimum and maximum viewport widths. Set font-size endpoints, root size, a ratio and the number of scale steps.

The output combines rem and vw in clamp() expressions. Preview the first scale step at a chosen width and export CSS variables or a Tailwind configuration fragment.

How to use

  1. Set minimum and maximum viewport and font sizes in CSS pixels.
  2. Choose the assumed root size, scale ratio and number of steps.
  3. Generate, move the preview width slider and copy or download the CSS.

Frequently asked questions

How is the preferred size calculated?

Linear interpolation gives a slope in vw and a constant offset in rem. clamp() bounds that value between the chosen endpoints.

Why does root size matter?

The rem conversion assumes the specified root font size. A different root changes actual rendering; test browser zoom and user font settings.

Does it handle shrinking type scales?

No. Maximum font size must be at least the minimum. The supported ratio is 1–2.

Is the Tailwind output a complete project?

No. It is a configuration fragment for font-size values. Adapt it to the Tailwind version and configuration used by your project.

Endpoints and scale steps

The first step uses the supplied minimum and maximum font size. Each following step multiplies both endpoints by the chosen ratio.

Viewport endpoints use CSS pixels. Device pixels and display DPI are unrelated to the interpolation.

Responsive accessibility

Fluid sizing should still work with zoom, long translations and user font preferences. A mathematical scale does not guarantee an accessible layout.

Preview values evaluate the same interpolation numerically. Test the exported CSS in the real layout before shipping.