Body text that jumps from 16px to 18px at one breakpoint feels fine. A display line that jumps from 32px to 64px at the same breakpoint feels like a light switched on. A fluid font-size glides. This calculator writes a clamp() aimed at font-size: the minimum type size, the maximum type size, and the viewport widths where those sizes should land. The opening numbers, 16 and 32 between 320 and 1280, produce clamp(16px, 10.66667px + 1.66667vw, 32px).
Put that on font-size, not on every property. A line-height in clamp units is a separate decision and often wants to stay unitless. The general clamp page is the same formula for padding, gaps, and widths. The difference is the job you are doing. Here the numbers are type sizes, and the failure mode is text: too small to read at the minimum, or so large at the maximum that a four-word headline wraps into a stack. Check the real words at both viewport widths, not just the computed pixel value.
The wide width must exceed the narrow width. A heading that should shrink as the screen grows is unusual. If that is truly the brief, the minimum field is still the size at the narrow viewport, so put the larger type size there.
Minimum 16px, maximum 32px, narrow 320px, wide 1280px.
clamp(16px, 10.66667px + 1.66667vw, 32px). Use it as font-size. At 320px the used size is 16px. At 1280px it is 32px. For a real body style, a maximum of 18 or 20 is usually enough. 32 is a display size.
Oddsock runs this in your browser. It is free, it does not upload the work, and it does not ask for an account.
No. The arithmetic is the same. This page is for font-size. The clamp page is for any length, including the gap under the heading.
Usually leave line-height unitless, such as 1.2, so it follows the font-size you just set. A second clamp on line-height is easy to over-tune.
The minimum is still too big for those words on that screen, or the line should be allowed to wrap. Clamp will not shrink below the minimum you typed.
Because 32px is display type. The opening numbers demonstrate the math. For running text, keep the maximum close to the minimum.
The output is in px and vw. If your type scale is in rem, the type-scale page is the one that divides by the root. You can still wrap a rem-based thought in clamp by converting your targets first.