Skip to content
Web Codes Stack
Explore Free Tools

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

Size limits
Viewport range (px)

Live preview

Font size 24 px

800 px

Type that scales

Use the clamp() value in CSS

  1. 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.
  2. Choose px for pixel sizes or rem for sizes relative to the root font size. For rem, enter the computed font size of your page’s html element so the preview matches your site.
  3. Paste the value into a CSS property such as font-size, padding, or gap.
font-size: clamp(16px, calc(8px + 2.5vw), 40px);