CSS Clamp Generator
Generate CSS clamp() values for fluid typography and spacing — responsive sizes without media queries.
Viewport Range
Value Range
About CSS clamp()
The CSS clamp() function takes three values: a minimum, a preferred (fluid) value, and a maximum. It clamps the preferred value between the min and max bounds. For fluid typography: clamp(1rem, 2.5vw + 0.5rem, 3rem) means the font size is at least 1rem, at most 3rem, and scales smoothly between those bounds relative to the viewport width — no media queries needed.
The preferred value is a linear interpolation between your min and max values across your viewport range. The formula: slope = (maxVal - minVal) / (maxVp - minVp) and intercept = minVal - slope * minVp. This generates a calc() expression for the fluid middle value that, combined with clamp, creates perfectly smooth responsive scaling.