Technology· Tools for builders
Generate a fluid CSS clamp() value that scales between two screen widths.
Formula
slope = (max size − min size) ÷ (max width − min width); clamp(min, base + slope × 100vw, max)
Worked example
16 px at 320 px wide up to 32 px at 1280 px is clamp(1rem, 0.6667rem + 1.6667vw, 2rem).
Free to use with a link back. Nothing you type is shared.
Preparing citation…
Keep exploring
Reduce image or screen dimensions to their simplest whole-number ratio.
Open calculatorCalculate a display's pixel density (pixels per inch) and dot pitch from resolution and diagonal size.
Open calculatorConvert colours between HEX, RGB and HSL, with WCAG contrast against white and black.
Open calculator