Skip to content
Local

Design

CSS Clamp Generator

Make a font size or spacing grow smoothly between two screen widths, written as a CSS clamp() with a live preview.

Runs in your browser. Nothing leaves this device.

Open CSS Clamp Generator

Free, no account, no watermark and no daily limit.

Open CSS Clamp Generator

How to use CSS Clamp Generator

  1. 1Type the smallest and largest size you want.
  2. 2Type the screen widths where each one should apply.
  3. 3Drag the preview slider to check it, then copy the CSS.

Questions

How is the middle value worked out?

The size grows in a straight line between the two screen widths. The tool finds that line as a fixed part plus a part in vw, and clamp() keeps it between your smallest and largest size.

Why use rem instead of px?

rem follows the reader's browser font setting, so text still grows when someone sets a larger default size. Pick px if your project uses px everywhere.

Can the size shrink on wider screens?

Yes. Make the largest size box smaller than the smallest size box and the slope turns negative. clamp() still keeps it between the two.

Is anything I type sent anywhere?

No. It is all worked out in your browser.

Is it free?

Yes. No account, no watermark and no daily limit.

Esc