CSS Clamp Generator
Generate fluid responsive CSS clamp() values for font sizes with live preview.
① Set min/max font sizes and viewports ② Click Generate ③ Copy the clamp() CSS value
What is CSS clamp() for fluid typography?
The CSS clamp(min, preferred, max) function enables truly fluid typography that scales smoothly between any two viewport widths without breakpoints. The preferred value combines a viewport-relative unit (vw) and a rem offset, calculated so the font size exactly equals the minimum at the minimum viewport and the maximum at the maximum viewport. This technique — popularized by Mike Riethmuller and later formalized by tools like Utopia — produces a single CSS declaration that replaces multiple @media query overrides. The slope (vw coefficient) controls how fast the font grows with the viewport, while the intercept (rem offset) anchors the baseline. Using rem units ensures the scale respects the user's browser font size preferences, which is critical for WCAG 1.4.4 compliance.