Interfaces and CSSRuns in your browser

Typography Scale Generator

Configure a text-size scale for your interface and copy CSS variables. The generator calculates sizes without analyzing fonts.

  • Base px + ratio
  • px and rem output
  • CSS variables
Online tool

Try the tool

Add your data, choose the settings, and get the result.

Input

Result

--font-size-minus-2: 10.24px;
--font-size-minus-1: 12.8px;
--font-size-0: 16px;
--font-size-1: 20px;
--font-size-2: 25px;
--font-size-3: 31.25px;
--font-size-4: 39.063px;
--font-size-5: 48.828px;
  • -2: 10.24px / 0.64rem
  • -1: 12.8px / 0.8rem
  • 0: 16px / 1rem
  • 1: 20px / 1.25rem
  • 2: 25px / 1.5625rem
  • 3: 31.25px / 1.9531rem
  • 4: 39.063px / 2.4414rem
  • 5: 48.828px / 3.0518rem

Processing in your browser

Text and selected files are processed in the current browser and are not sent to a server to produce the result.

Reviewed: 2026-07-17
01

How to use it

  1. 1

    Enter the base text size in px.

  2. 2

    Set the ratio and step range.

  3. 3

    Copy the CSS custom properties.

02

What the tool can do

  • Steps from smaller text values to larger heading values.
  • Calculates px and rem relative to the selected base.
  • Generates CSS custom properties for a design system.
03

Common use cases

  • Preparing font-size tokens for a UI kit.
  • Comparing a ratio before redesigning a typography scale.
  • Quickly generating px/rem values for documentation.
04

How it works inside

Each step is calculated as base multiplied by ratio to the step power.

The step range is limited.

05

Questions and answers

How can I choose sizes for headings and body text?

Enter a base size and scale ratio. The generator calculates a sequence of sizes for your styles. Try it with real headings and paragraphs; one ratio will not suit every interface.

Will the generator choose a font and line spacing?

It calculates font sizes. Choose the font family, weight, and line height separately. After applying the sizes, check long headings and text on a narrow screen.