Web design
Create a modular type scale
Define related font sizes for a consistent system.
1. Choose body size
Start with a tested size such as 16px. Compare how the actual font looks at that size.
2. Select a ratio
A 1.25 ratio gives 20, 25 and 31.25px above 16px. Dense tools may benefit from smaller steps.
3. Assign roles
Use a limited set for headings, body, labels and captions. Avoid inventing a different size for every component.
4. Proof the system
Round values where useful and test actual content at narrow and wide widths. Set line height and weight per role.
Turn a ratio into design roles
Starting with 16px and a ratio of 1.25, the first three upward steps are 20px, 25px and 31.25px. Assign 16 to body, 20 to a section label, 25 to a subheading and about 31 to a title. If 31.25 does not suit your layout, round deliberately and keep the hierarchy consistent. Choose line-height and weight separately.
Common pitfall
A modular scale is a planning tool, not a rule that every type size must obey. Compare real text at narrow widths before using the same scale in dense controls or long articles.