CSS Clamp Generator
Enter min/max values and viewport widths, then get a ready-to-paste CSS clamp() expression with a live viewport simulator to preview the scaling.
Clamp Parameters
Presets
Generated Output
Fill in the parameters above and click Generate clamp().
CSS value
Example property declaration
Tailwind CSS arbitrary value
Math breakdown
Slope (m)
—
Intercept (b)
—
Fluid range
—
Viewport Simulator
800 px
320
1920
800 px wide
The quick brown fox jumps over the lazy dog
font-size: —
minmax
Summary
Enter min/max values and viewport widths, then get a ready-to-paste CSS clamp() expression with a live viewport simulator to preview the scaling.
How it works
- Enter the minimum value and unit (px, rem, or em) for the smallest viewport.
- Enter the maximum value and unit for the largest viewport.
- Set the minimum and maximum viewport widths in pixels.
- Choose your preferred fluid unit (vw, vh, or cqi) for the middle value.
- Click Generate to get the clamp() expression, then copy it or use the Tailwind class.
- Drag the Viewport Simulator slider to preview how the value scales across screen sizes.
Use cases
- Set fluid heading sizes that scale smoothly between mobile and desktop without media queries.
- Generate responsive padding or margin values for section containers.
- Create fluid line-height or letter-spacing that adapts to viewport width.
Frequently Asked Questions
Last updated: 2026-06-09 ·
Reviewed by Nham Vu