blackdroid.dev

CSS Clamp Calculator

Generate fluid typography with CSS clamp(). Set min/max size and viewport range, copy the clamp() value and preview the scaling live.

e.g. 320 mobile
e.g. 1200 desktop
clamp(1rem, 0.9091vw + 0.8182rem, 1.5rem)
Preview width: 768px
20.1px
The quick brown fox jumps over the lazy dog

About CSS Clamp Calculator

Build a fluid font-size that scales smoothly between a minimum and maximum across a viewport range — the tool emits the standard clamp(min, vw-slope, max) expression in rem.

Drag the preview slider to watch the computed size at any viewport width before copying the CSS. Runs locally in your browser.

How to use CSS Clamp Calculator

  1. Enter the minimum and maximum font size in pixels.
  2. Set the viewport range — e.g. 320px mobile to 1200px desktop.
  3. Copy the clamp() expression and try the live size preview.

Frequently asked questions

What does CSS clamp() do?

clamp(MIN, PREFERRED, MAX) picks PREFERRED but never goes below MIN or above MAX — perfect for fluid typography that scales with the viewport without media queries.

Why does the output use rem and vw together?

The vw term drives the scaling while rem keeps it tied to the user's font preference — the standard accessible pattern for fluid type.

What are good clamp() ranges?

Body text commonly goes 16–18px between 320–1200px viewports; headings scale wider, e.g. 28–48px. The preview slider shows the result at any width.