CSS Clamp Generator

Generate fluid CSS clamp() values between two viewport widths.

Runs entirely in your browser
CSS
clamp(1rem, 0.8571rem + 0.7143vw, 1.5rem)

Preview

The quick brown fox jumps over the lazy dog.

Resize the viewport to see the value scale between 1rem and 1.5rem.

FAQ

Why not just use vw?
Pure vw shrinks to unreadable at 320px and balloons on 4K monitors. clamp() caps both ends so the value stays within a sensible range.
How is the middle expression built?
The tool solves a linear equation: at minViewport the value equals minSize, at maxViewport it equals maxSize. That gives you slope-per-vw and an intercept in rem.

Related tools