Home / Generate / CSS clamp() Calculator
↕️ CSS clamp() Calculator
CSS clamp() Calculator – get instant, free results right on your device.
The size increases linearly with the screen width and is fixed at the lower and upper limits. Using only vw for font size can prevent zooming, which is why it is combined with rem. Not an official institution.
Last updated: November 2026 · Parameter year: 2026 · Methods and sources: Methodology · Editorial policy
What is CSS clamp() Calculator?
The CSS clamp() function defines the minimum, preferred, and maximum bounds of a value in a single line. It is used for fluid font sizes: the text stays at the minimum size on small screens and at the maximum size on large screens, and in between it grows in proportion to the screen width. Working out the right formula by hand is tedious.
Enter the minimum and maximum sizes (px), the minimum and maximum screen widths at which these sizes apply, and the root font size. The tool calculates the rem and vw units and gives a ready-made clamp(...) expression, a usage line, and the result for three sample screen widths. For example, for 16px–32px and 320–1200px you get clamp(1rem, 0.6364rem + 1.8182vw, 2rem).
Size scales linearly between the limits. Using only vw for font size can break zoom accessibility, so a format that combines it with rem is recommended. The calculation runs in your browser. To convert between px and rem, see the PX REM EM Converter.
How to use
Fill in these fields: Minimum size, Maximum size, Minimum screen width, Maximum screen width, Root font size. Then press the button; the result appears on the same page and your data never leaves your device.
Formula
16px–32px, 320–1200px → clamp(1rem, 0.6364rem + 1.8182vw, 2rem)
Example
16px–32px, 320–1200px → clamp(1rem, 0.6364rem + 1.8182vw, 2rem)
Worked examples and tips
Example 1: With the default values, that is, 16px minimum size, 32px maximum size, a screen range of 320px to 1200px and a 16px root size, the tool produces the expression clamp(1rem, 0.6364rem + 1.8182vw, 2rem). On sample screens you get 16px at 320px, 24px at 760px and 32px at 1200px.
Example 2: If you want to spread body text from 14px to 20px across a screen range of 375px to 1440px, the result is clamp(0.875rem, 0.743rem + 0.5634vw, 1.25rem). At a width of 908px, the text appears at about 17.0028px.
Example 3: If you tie 24px to 56px for a large heading to screens of 400px to 1600px, you get clamp(1.5rem, 0.8333rem + 2.6667vw, 3.5rem); on a 1000px screen you get exactly 40px.
Tips and common mistakes: If you have set the root font size to something other than 16px, also change the root size field in the tool, otherwise the rem equivalents will be off. Using vw alone ignores the user's browser text zoom; it is better for accessibility for the expression to contain a sum of rem and vw. Entering the smallest screen width larger than the largest width produces a meaningless slope. You can use the generated line directly in font-size, padding or margin properties.
Frequently asked questions
CSS clamp() Calculator – how to use it?
Fill in the fields and press the button; the result appears instantly. Example: 16px–32px, 320–1200px → clamp(1rem, 0.6364rem + 1.8182vw, 2rem)
CSS clamp() Calculator – is it free, and is my data stored?
Yes, it is free and requires no sign-up. Because processing happens in your browser, the information you enter is not sent to a server.
Related guide
- How to Make Fluid Font Sizes with CSS clamp(): Formula, Ready Values and Glassmorphism – How is CSS clamp(min, preferred, max) calculated? The formula for fluid type between two screen widths, 3 worked examples, rem and accessibility notes.