CSS Clamp Generator

Calculate a linear responsive CSS clamp between two viewport widths and two pixel sizes.

Your workspace

Server processing

Review the example values, then run the tool.

This tool calculates a linear responsive CSS clamp property based on your specified minimum and maximum viewport widths and pixel sizes.

How to generate a clamp declaration

  1. Enter the minimum and maximum pixel sizes you want the element to scale between.
  2. Define the minimum and maximum viewport widths that trigger this scaling range.
  3. Copy the generated CSS clamp declaration to use in your stylesheet.

Calculation method

The tool uses linear interpolation to determine the slope and intercept required for the CSS clamp function. It calculates the exact point where the size transitions between your minimum and maximum constraints relative to the viewport width.

Data handling and limits

All calculations occur on this server immediately after submission. Generated code is not executed or stored permanently. Outputs expire after 15 minutes, so ensure you copy your generated CSS before the session ends.

Responsive font scaling

Min size: 16px, Max size: 32px, Min width: 320px, Max width: 1440px

font-size: clamp(16px, calc(11.4286px + 1.42857vw), 32px);

Frequently asked questions

Does this tool apply the CSS to my website?

No, this tool only generates the CSS string. You must copy and paste the code into your own project files.

Can I use units other than pixels?

This tool is specifically configured to calculate clamps using pixel values for sizes and viewport widths.

Continue your workflow