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().

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

  1. Enter the minimum value and unit (px, rem, or em) for the smallest viewport.
  2. Enter the maximum value and unit for the largest viewport.
  3. Set the minimum and maximum viewport widths in pixels.
  4. Choose your preferred fluid unit (vw, vh, or cqi) for the middle value.
  5. Click Generate to get the clamp() expression, then copy it or use the Tailwind class.
  6. 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