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.
How to use CSS Clamp Generator
- 1Type the smallest and largest size you want.
- 2Type the screen widths where each one should apply.
- 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.
Related tools
- DesignColour ConverterConvert a colour between HEX, RGB, HSL, HSV, HWB, OKLCH and CMYK, and check its contrast against white and black.
- DesignColour Picker from ImageClick anywhere on an image to get the exact colour as HEX, RGB and HSL, and see its main colours.
- DesignAspect Ratio CalculatorFind the aspect ratio of any width and height, resize to a new width or height at the same ratio, and see megapixels and common sizes.
- DesignBackground & Wallpaper GeneratorMake mesh gradients, grain textures and dot, grid, wave or stripe patterns at any size, then download a PNG or copy the CSS.
- DesignBorder Radius GeneratorRound each corner of a box in pixels or percent, see the shape change and copy the shortest CSS.
- DesignBox Shadow GeneratorSet the offset, blur, spread and colour of a CSS box shadow, watch it on a box and copy the CSS.