Select theme appearance

Typography scale calculator

Generate a fluid typography scale based on a few inputs.

Find out how it works

Everything is based on math. If you want a full breakdown, check out this guy: Aleksandr Hovhannisyan - Fluid type scale

He also has his own fluid type scale calculator, that is probably better than this one, but I needed a bit more flexibility in the scales.

Quick maths

Calculate slope

m = (maxFontSize - minFontSize) / (maxBreakpoint - minBreakpoint)
e.g.: m = (19px - 16px) / (1000px - 400px) = 1/20 = 0.005

Calculate y-intercept (b)

y = mx + b
16px = 0.005(400px) + b
b = y - mx
b = 16px - 0.005(400px) = 16px - 2px = 14px

Calculate preferred value

preferredValue = y = mx + b = 0.005(x) + 14px

Multiply slope by 100 and use vw

font-size: clamp(16px, 0.5vw + 14px, 19px);

Generate your scale

Ratio

Choose a minimum ratio and maximum ratio. Minimum ratio will be the scale for small viewports and scale up to the max.

Font Size Boundaries

Next choose a minimum and maximum font size (in px).

Viewport Boundaries

Now choose the minimum and maximum width (in px). Your sizes will scale between these viewport sizes.

Steps

Finally, define how many steps you want to generate. You can also skip steps for bigger steps.