Skip to content
ZeroServer.tools

CSS Clamp Calculator

Generate clamp() values for fluid, responsive typography and spacing.

Generated clamp()
clamp(16px, 1.4286vw + 11.4286px, 32px)
Live preview at 760px viewport22.3px
Preview text
Common use cases
h1 headingclamp(28px, 3.5vw + 16px, 56px)
Body textclamp(16px, 0.35vw + 14.7px, 20px)
Section spacingclamp(32px, 5.7vw + 13.7px, 96px)

How CSS clamp() works

CSS clamp(min, preferred, max) locks a value between a minimum and maximum while letting it scale fluidly with the viewport. The preferred value uses vw units plus a pixel offset — calculated from the slope of the linear interpolation between your min/max values at your min/max viewports. This means zero media queries for fluid typography and spacing.

Related tools: px to rem converter, CSS gradient generator, and the CSS flexbox generator.

Private & free — this tool runs entirely in your browser.

Recommended: IndieKit Ship your Next.js startup in days.affiliate

Related Design & CSS tools