๐Ÿ”’ Runs in your browser โ€” nothing is uploadedโœ“ Free, no signup

CSS Clamp() Calculator

Enter the smallest and largest size and the viewport range, and get a clamp() value that scales smoothly between them โ€” no media queries needed.

Values

Output unit

CSS

font-size: clamp(1rem, 0.8239rem + 0.7512vw, 1.5rem);

How it scales

Viewport widthComputed size
320px16px
375px16px
908px20px
1440px24px
1920px24px

At your current window width (1024px): 20.88px

The quick brown fox jumps over the lazy dog

When should you use the CSS Clamp Calculator?

  • Making headings shrink smoothly on phones
  • Fluid padding, gaps and margins
  • Building a responsive type scale

How to use the CSS Clamp Calculator

  1. 1

    Set the sizes

    The size at the smallest screen and at the largest screen, in px.

  2. 2

    Set the viewport range

    Usually 375px (phone) to 1280โ€“1440px (desktop).

  3. 3

    Choose the unit

    rem respects the user's font-size setting, so it's best for text.

  4. 4

    Copy

    Copy the clamp() value and check the table of computed sizes.

Examples

16px to 24px, 375px to 1440px

Values

Min 16px ยท Max 24px ยท Viewport 375px โ†’ 1440px ยท Root 16px

CSS

font-size: clamp(1rem, 0.8239rem + 0.7512vw, 1.5rem);

Common errors and how to fix them

The maximum viewport must be wider
The max viewport width has to be larger than the min viewport width.
Text doesn't grow when zooming
Use rem output โ€” a pure vw value ignores browser zoom, but the rem part keeps it accessible.
Related tools:ย PX to REM Converter ยท CSS Minifier ยท Box Shadow Generator

More from Design & Color

Free tools that run in your browser โ€” no signup, nothing uploaded.

CSS Clamp Calculator FAQ

clamp(min, preferred, max) uses the preferred value but never goes below min or above max. With a vw-based preferred value, sizes scale with the screen width.

It's the straight line between the two points: slope = (max size โˆ’ min size) รท (max viewport โˆ’ min viewport), written as a rem intercept plus slope ร— 100 vw.

rem follows the user's browser font size, which matters for accessibility. The calculator converts using your root font size (usually 16px).

Yes, in all modern browsers.

Yes โ€” padding, margin, gap and width all accept clamp().

No. Everything runs in your browser, so your data never leaves your device.