📏

CSS Clamp Generator

Generate fluid clamp() values for responsive sizing

🧑‍💻 Developer ToolsFreeRuns in your browser

CSS output

font-size: clamp(1rem, 0.6364rem + 1.8182vw, 2rem);

Preview

Fluid type scales with the viewport.

Rendered in a 1024px preview width — resize the browser to see the text grow.

ViewportComputed size
320px1rem (16px)
760px1.5rem (24px)
1200px2rem (32px)
1440px2rem (32px)
1920px2rem (32px)

clamp() keeps the value between the min and max while the middle term scales with the viewport. Both bounds are inclusive, so the text stops growing at the max viewport.

About the CSS Clamp Generator

The CSS Clamp Generator turns a min and max size into a fluid clamp() expression. Set the viewport range where scaling happens and copy a rule that grows smoothly between the two limits.

Fluid sizing works best when the min and max are chosen from real design breakpoints. Round the middle term to three or four decimals so the rule stays readable in review.

  • ✓Fluid font-size and spacing values
  • ✓Custom viewport and root size
  • ✓Size table across common viewports

How to use the CSS Clamp Generator

  1. 1

    Enter the min and max sizes in rem.

  2. 2

    Set the viewport range and root font size.

  3. 3

    Copy the generated clamp rule.

Frequently asked questions

Why do the generated values use rem and vw together?+

The rem part keeps the baseline tied to user font settings, and the vw part adds the scaling. Clamp then stops the result at the min and max.

Should I use clamp for everything?+

No. Reserve it for a few key sizes such as headings and section spacing. Applying it everywhere makes layouts harder to reason about and to test.

Save CSS Clamp Generator to your favorites, or keep browsing developer tools.

Browse all 35 developer tools →