CSS Clamp Generator
Generate a CSS clamp() value for fluid typography and spacing. Set your size limits and test how the value scales across viewport widths.
Size settings
Live preview
Font size 24 px
Type that scales
Use the clamp() value in CSS
- Set the smallest and largest sizes, then choose the viewport widths where they should apply. The size scales between those widths and stays within your limits.
- Choose
pxfor pixel sizes orremfor sizes relative to the root font size. Forrem, enter the computed font size of your page’shtmlelement so the preview matches your site. - Paste the value into a CSS property such as
font-size,padding, orgap.
font-size: clamp(16px, calc(8px + 2.5vw), 40px);