Clamp Calculator

Generate a precise clamp(min, fluid, max) from two viewport widths and size targets for responsive typography, layout spacing, and component sizing.

Build your clamp()

Resize the window to preview the fluid scale.

How clamp() is calculated

We compute a linear scale between your min and max viewports, then convert it to calc(intercept + slope vw) inside clamp(min, fluid, max). Use rem for typography if your site scales root font size.

  • Slope = ((maxSize − minSize) / (maxVw − minVw)) × 100 (per vw)
  • Intercept = minSize − (slope/100 × minVw)

Tip: Save your favorite pairs as presets in your design system so spacing stays consistent across pages.