Skip to content

Design tool

CSS clamp() Generator

Enter a minimum, a preferred vw value, and a maximum, then copy the clamp() CSS.

Stays in your browser Processed in your browser. The text is not sent to our servers.

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

  1. Enter the smallest size and the largest size.
  2. Enter the preferred value in vw, which sets how fast the size grows.
  3. 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.

Back to Design tools

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.

More questions on the FAQ page · Browse guides

Keep working without leaving the site.