b2KIT

Responsive Font Size Calculator

Calculate fluid typography using CSS clamp() with min/max size and viewport-based scaling.

Tested tool guide Tested browser tools Checked August 16, 2026

What Responsive Font Size Calculator does, with a checked example

This tool converts two font sizes and the screen-width range between them into one CSS declaration: font-size: clamp(min, calc(offset + coefficient*vw), max). You enter a small size, a large size, and the narrowest and widest viewports between which the text should grow; the tool fits a straight line through those two points and emits a ready-to-paste rule. What surprises most users: outside the viewport range you chose, the size stops scaling. Below the narrow width the text holds at the minimum, above the wide width it holds at the maximum. That flatness is the clamp at work, not a bug.

Worked example

A concrete input and expected output from the current implementation.

Input

Min size 16px at viewport 320px; max size 24px at viewport 1280px

Expected output

clamp(16px, calc(13.33px + 0.83vw), 24px)

The preferred value is a line through (320, 16) and (1280, 24): 8px of growth over 960px of viewport gives a 0.83vw coefficient, and the intercept lands at 13.33px. Check: 13.33 + 0.83 x 3.2 = 16.0 and 13.33 + 0.83 x 12.8 = 24.0 at the endpoints.

How the result is produced

1

Linear interpolation

At any width the preferred size is minSize + (maxSize - minSize) x (100vw - minVw) / (maxVw - minVw). The tool expands this into a constant plus a vw coefficient, so the calc in the output has exactly two terms. The clamp() min and max arguments then enforce the endpoints: the browser caps the result at the minimum below your narrow viewport and at the maximum above the wide one.

2

Reading and placing the output

The result is a complete declaration value, so you paste it as font-size: clamp(...) inside an existing rule and nothing else is needed. One vw is one percent of the current viewport width, so the coefficient scales continuously with the browser window, no media queries involved. Units pass through: enter px and you get px; enter rem and you get rem, which the browser resolves against the root font size.

Good uses

  • A heading that grows smoothly: size an H1 at 28px on small phones and 48px on desktop, and let it interpolate across the range instead of jumping at a breakpoint.
  • Body text that stays readable on ultrawide monitors: clamp a paragraph between 16px and 18px over 375px to 1440px so line length does not blow out on 2560px-wide screens.
  • Replacing two media-query rules with one declaration when your type scale is linear: one clamp covers the whole design instead of a phone rule plus a desktop rule.

Limits and checks

  • Flat outside the range. The min and max arguments are hard limits: below your chosen narrow viewport the size is pinned to the minimum, above the wide viewport it is pinned to the maximum. If you want continued growth, widen the viewport bounds you entered.
  • Rounded numbers. The vw coefficient and the constant are rounded, typically to two decimals, so computed sizes differ from the exact line by fractions of a pixel and the endpoints can be a hundredth of a pixel off. Invisible when rendered, but do not treat the output as exact arithmetic.
  • Rem resolves against the root. If you enter rem values, the browser multiplies them by the root font size, normally 16px. Anyone who changes the html font size changes every rendered pixel, and the vw term keeps scaling with the viewport regardless.

Common questions

Why does the text stop growing when I widen my window past the max viewport?

Because clamp() enforces hard limits: the first and third arguments are absolute bounds and the middle calc() only applies between them. The flat top is the point of the tool, not a bug - it is how you stop headlines becoming enormous on very wide monitors. If you wanted unbounded growth, you would need a bare calc() with no clamp.

Do I still need a fallback for older browsers?

clamp() has been supported in all evergreen browsers since 2020 (Chrome 79, Firefox 75, Safari 13.1), so the single rule is fine for modern targets. If you must support anything older, put a plain font-size line with a fixed value above the clamp declaration; unsupported browsers ignore the clamp line and keep the fallback.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools