CSS clamp() generator
Generate a fluid CSS clamp() value that scales smoothly between two viewport widths.
CSS clamp() generator
Fluid typography and spacing scale a value smoothly as the viewport resizes, instead of jumping between fixed sizes at a handful of media-query breakpoints. This tool builds that value for you: enter a minimum and maximum size and the viewport widths they apply at, and it returns a CSS clamp() function with a linear interpolation in between, ready to paste into a stylesheet.
Minimum size and maximum size set the two ends of the scale; minimum and maximum viewport width set where each end kicks in — below the minimum width the value stays at its floor, above the maximum it stays at its ceiling, and in between it grows linearly with the viewport. Unit switches the output between px and rem, with root font size controlling the px-to-rem conversion, and decimal places controls how much precision the generated numbers carry. Output format wraps the same clamp() as a plain declaration, a CSS custom property, or a Tailwind arbitrary-value class, so you can drop it straight into whichever codebase you're working in.
Turning on the accessibility check adds a note when the setup could cause trouble: px-based sizing ignores a reader's browser font-size preference, and a minimum that's too small stays hard to read even before it starts scaling up. Both are common mistakes in hand-written fluid type formulas, and the tool flags them instead of shipping them silently.
Everything is computed in your browser as you adjust the options — nothing you enter is sent anywhere. When the result looks right, copy it, download it as a .txt file, or send it to another tool's input to keep working on it.