Skip to content
OddsockLocal
Local
Minimum size (px)16
Maximum size (px)32
Narrow viewport (px)320
Wide viewport (px)1280
Minimum size (px)16
Maximum size (px)32
Narrow viewport (px)320
Wide viewport (px)1280
ReadyRuns in this browser. Nothing is uploaded.

How to use

  1. Set the font size you want on the narrow viewport and on the wide one.
  2. Set those viewport widths in pixels.
  3. Copy the clamp() into font-size.
  4. Load the real heading at both widths. Wrapping, not the formula, is the usual failure.

What is Responsive font size?

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

Read more

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.

Use cases

  • A marketing headline scales from 40px on a phone to 72px on a desktop and then stops.
  • Body copy moves from 16px to 18px across the same range, a small slope that barely shows.
  • A design system documents one clamp per display step instead of three media queries.
  • A developer verifies the preferred value hits 16px at 320px wide before shipping it.
  • A bilingual page checks that the longer translation still fits at the maximum size.

Body size from phone to desktop

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.

Why use Oddsock

Oddsock runs this in your browser. It is free, it does not upload the work, and it does not ask for an account.

Related tools

Using this tool

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.