Skip to content
OddsockLocal
Local
Base size (px)16
Scale factor1.25
Steps6
Root font size (px)16
Base size (px)16
Scale factor1.25
Steps6
Root font size (px)16
ReadyRuns in this browser. Nothing is uploaded.

How to use

  1. Set the base size, usually the body size, in pixels.
  2. Set the ratio. 1.25 is a modest ramp. 1.5 is a steep one.
  3. Set the steps and the root used for rem.
  4. Copy the variables onto the actual heading levels and read a real headline at step 5 or 6.

What is Type scale?

A page with font sizes of 15, 17, 19, 22, and 27 has no rule, so the next size is a guess. A modular scale multiplies a base by the same ratio. This page writes --type-1 onward in rem, with the pixel size in a comment. The opening base is 16px, the ratio is 1.25, there are 6 steps, and the root is 16. The pixels are 16, 20, 25, 31.25, 39.0625, and 48.82813. In the stylesheet they are 1rem, 1.25rem, 1.5625rem, 1.95313rem, 2.44141rem, and 3.05176rem.

Read more

1.25 is a major third, a common text ramp: enough change that a heading is clearly a heading, not so much that step 6 becomes a poster. A ratio of 1.5 or 1.618 climbs faster and is easier to overshoot on a phone. The spacing scale is the same generator aimed at gaps, and it opens on a ratio of 2 because space and type should not be forced to share a number.

Fractional pixels are honest. 31.25px is what 16 times 1.25 three times actually is. Browsers render it. If you hate the fraction, round in your own stylesheet after you copy, and know that rounding breaks the ratio slightly. The comments are rounded to a readable number of decimals. They are still the computed sizes.

Use cases

  • A product type ramp is generated from 16px at 1.25 and pasted into :root.
  • A marketing page tries 1.333 and looks at whether step 5 still fits a phone width.
  • A developer stops picking 17px because it was 'a bit bigger than 16.'
  • A design critique compares a 1.25 scale with a 1.5 scale on the same base.
  • A team documents the rem values next to the pixels so a root-size change is understandable.

A major third from 16px

Base 16, ratio 1.25, 6 steps, root 16.

:root { --type-1: 1rem; /* 16px */ --type-2: 1.25rem; /* 20px */ --type-3: 1.5625rem; /* 25px */ --type-4: 1.95313rem; /* 31.25px */ --type-5: 2.44141rem; /* 39.0625px */ --type-6: 3.05176rem; /* 48.82813px */ }

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

1.25 keeps six steps in a practical range, from 16px to about 49px. 1.5 reaches poster sizes quickly. Try the words at the largest step before you commit.