CSS Clamp Calculator

Calculate a simple fluid pixel size with CSS clamp().

Scope: Uses linear interpolation between two pixel sizes and viewport widths.

Workbench

Inputs stay on this page.

How to use CSS Clamp Calculator

  1. Fill in the fields:

    • Minimum size (px): 0 to 10,000.
    • Maximum size (px): 0 to 10,000.
    • Minimum viewport (px): 1 to 100,000.
    • Maximum viewport (px): 1 to 100,000.
  2. Press “Calculate clamp”.

  3. Copy the result, or download it as clamp.css.