CSS clamp() generator
Build a fluid clamp() value between two viewport widths. A px to rem converter is on the same page.
Runs in your browser. Nothing you enter is uploaded.
The quick brown fox jumps over the lazy dog.
px to rem
About this tool
The clamp() generator builds a CSS clamp() value that grows linearly from a minimum size at one viewport width to a maximum size at another. You enter pixels, and the output is in rem plus vw, based on the root font size you set. A px to rem converter sits on the same page.
- Why is the output in rem and not px?
- With rem the size still follows the user’s browser font setting. The vw part keeps the fluid growth between the two widths.
- Can the size shrink as the screen gets wider?
- Yes. Set the larger size at the smaller width and the slope becomes negative. The lower and upper bounds in clamp() are still ordered correctly.