CSS Clamp Calculator
Free CSS clamp() calculator and fluid type scale generator. Enter min/max font size and viewport widths, get a ready-to-paste clamp() value in px and rem.
Your clamp() value
font-size: clamp(16px, calc(0.9091vw + 13.09px), 24px);Slope0.909vw per px
At 320px16px
At 1200px24px
Range1rem → 1.5rem
| Step | Min → Max | clamp() | rem |
|---|---|---|---|
| -2 | 11.11px → 16.67px | font-size: clamp(11.11px, calc(0.6318vw + 9.09px), 16.67px); | 0.694rem → 1.042rem |
| -1 | 13.33px → 20px | font-size: clamp(13.33px, calc(0.758vw + 10.9px), 20px); | 0.833rem → 1.25rem |
| Base | 16px → 24px | font-size: clamp(16px, calc(0.9091vw + 13.09px), 24px); | 1rem → 1.5rem |
| +1 | 19.2px → 28.8px | font-size: clamp(19.2px, calc(1.0909vw + 15.71px), 28.8px); | 1.2rem → 1.8rem |
| +2 | 23.04px → 34.56px | font-size: clamp(23.04px, calc(1.3091vw + 18.85px), 34.56px); | 1.44rem → 2.16rem |
| +3 | 27.65px → 41.47px | font-size: clamp(27.65px, calc(1.5705vw + 22.62px), 41.47px); | 1.728rem → 2.592rem |
How the CSS Clamp Calculator works
clamp(min, preferred, max) takes three parameters: a floor, a preferred value that scales with the viewport, and a ceiling. This calculator turns your min/max font sizes and viewport widths into the preferred calc() expression, then generates a full fluid type scale — every step gets its own ready-to-paste clamp() line in px and rem.
One line replaces the media queries you would otherwise write for mobile, tablet and desktop: text stays 16px at 320px and below, grows linearly, and stops at 24px once the viewport passes 1200px.
FAQ
- What do the three clamp() parameters mean?
- clamp(min, preferred, max): min is the smallest allowed value, max is the largest, and preferred is the ideal value that scales with the viewport — here a calc() expression mixing vw and px. Below the min viewport the value floors at min; above the max viewport it caps at max.
- Should I use clamp() or media queries for fluid typography?
- For a single element that should scale continuously, clamp() is simpler and needs one line instead of several media query breakpoints. Media queries are still better when you want discrete jumps, per-breakpoint layout changes or values that must not scale at all.
- Do all browsers support CSS clamp()?
- clamp() works in all modern browsers (Chrome 79+, Firefox 75+, Safari 13.1+, Edge 79+). It does not work in Internet Explorer, so ship it as progressive enhancement: declare a static font-size first, then override it with the clamp() line — old browsers keep the static value.
- Is this clamp generator free to use?
- Yes. The CSS clamp calculator runs entirely in your browser, is free with no sign-up, and you can copy as many values as you like.