Design tool
CSS clamp() Generator
Enter a minimum, a preferred vw value, and a maximum, then copy the clamp() CSS.
Enter the smallest size, how fast it should grow with the screen width, and the largest size.
Tip: press Ctrl+Enter (or ⌘+Enter) to run from a text box.
Result will show here after you run the tool.
How to build a CSS clamp() value
- Enter the smallest size and the largest size.
- Enter the preferred value in vw, which sets how fast the size grows.
- Click Generate and copy the clamp() value.
clamp(1rem, 2.5vw, 2rem) keeps the size between 1rem and 2rem and scales with the viewport in between. Using rem for the limits keeps the text responsive to the reader zoom setting.
Frequently asked questions
Should I use rem or px?
rem is the safer default because it follows the reader font size. Switch to px only when you need fixed limits.
Is anything uploaded?
No. The value is built in your browser.
Related design tools
Keep working without leaving the site.
Color converter
Switch a color between HEX, RGB, and HSL.
Open toolColor contrast checker
See whether two colors pass WCAG AA and AAA.
Open toolPX and REM
Convert pixels to rem, or rem back to pixels.
Open toolBox shadow
Preview a box-shadow and copy the CSS property.
Open toolBorder radius
Preview a border-radius and copy the CSS property.
Open toolTints and shades
Build lighter and darker steps from one hex color.
Open tool