Modular Scale Explained
Understand modular scales, type ratios, responsive typography and how to create consistent font-size systems for web interfaces.
A modular scale is a system for choosing related font sizes, spacing values or other design dimensions by multiplying a base value by a consistent ratio. Instead of selecting every heading size independently, a modular scale creates a predictable mathematical relationship between values.
Modular scales are especially useful in typography because they help create visual hierarchy. Body text, small labels, headings and large display text can follow the same underlying scale, making an interface feel more consistent and easier to design.
What Is a Modular Scale?
A modular scale starts with a base value and a ratio. Each step is calculated by multiplying or dividing the previous value by that ratio. In typography, the base value is often the body font size, while the ratio determines how quickly headings increase in size.
Next Size = Current Size × RatioFor example, if the base font size is 16px and the ratio is 1.25, the next larger value is 20px. Repeating the calculation produces a sequence of related sizes.
16 × 1.25 = 20
20 × 1.25 = 25
25 × 1.25 = 31.25
31.25 × 1.25 = 39.06Why Use a Modular Scale?
Without a scale, designers and developers often choose values such as 16px, 21px, 27px, 34px and 42px manually. These values can work, but they may not have a clear relationship. A modular scale provides a repeatable rule that makes the type system easier to build and maintain.
- Creates consistent visual hierarchy.
- Reduces arbitrary font-size decisions.
- Makes design systems easier to maintain.
- Provides predictable relationships between headings.
- Helps designers and developers communicate using shared values.
- Makes responsive typography easier to structure.
Base Size and Ratio
Two values define the basic structure of a modular typography scale: the base size and the ratio. The base size is commonly the default body text size, while the ratio controls the distance between consecutive sizes.
| Value | Purpose |
|---|---|
| Base size | Starting font size for the scale |
| Ratio | Multiplier between scale steps |
| Scale steps | Individual sizes generated from the base |
Common Modular Scale Ratios
Different ratios create different visual rhythms. Smaller ratios produce a more subtle hierarchy, while larger ratios create stronger differences between headings and body text.
| Ratio | Common Name | Typical Character |
|---|---|---|
| 1.067 | Minor Second | Very subtle progression |
| 1.125 | Major Second | Small and restrained hierarchy |
| 1.200 | Minor Third | Moderate progression |
| 1.250 | Major Third | Balanced and widely useful |
| 1.333 | Perfect Fourth | Clear hierarchy |
| 1.414 | Augmented Fourth | Strong progression |
| 1.500 | Perfect Fifth | Large visual differences |
| 1.618 | Golden Ratio | Strong, expressive scale |
The 1.25 Ratio
A ratio of 1.25 is a popular choice for web typography because it creates noticeable hierarchy without making headings grow too quickly. Starting from a 16px base, the scale produces values that can be rounded for practical CSS use.
16px
20px
25px
31.25px
39.06px
48.83px
61.04pxThe exact generated values do not always need to be preserved. Designers commonly round them to practical values such as 20px, 25px, 32px, 40px and 49px, depending on the design system.
The 1.333 Ratio
A ratio around 1.333, commonly called a Perfect Fourth, creates a stronger hierarchy. It can work well for editorial websites, documentation and interfaces where headings need to be clearly differentiated from body text.
16px
21.33px
28.44px
37.93px
50.57px
67.43pxThe Golden Ratio
The golden ratio, approximately 1.618, produces a much more dramatic progression. It can be useful for large display typography, landing pages and visually expressive designs, but it may be too aggressive for ordinary interface text.
16px
25.89px
41.89px
67.78px
109.67pxMajor Scale vs Minor Scale Steps
A modular scale can extend in both directions from the base size. Multiplying by the ratio creates larger values, while dividing by the ratio creates smaller values. This allows the same system to define captions, labels, body text, headings and display sizes.
Small
↓ divide by ratio
Base
↓ multiply by ratio
Large
↓ multiply by ratio
Larger| Step | Example with 1.25 Ratio |
|---|---|
| -2 | 10.24px |
| -1 | 12.8px |
| 0 | 16px |
| +1 | 20px |
| +2 | 25px |
| +3 | 31.25px |
| +4 | 39.06px |
| +5 | 48.83px |
Using Modular Scales for Headings
A practical typography system does not have to assign every scale step to a heading. Some values can be used for body text, metadata and labels, while selected larger steps become h1, h2, h3 and other heading levels.
body {
font-size: 1rem;
}
h3 {
font-size: 1.5625rem;
}
h2 {
font-size: 1.953rem;
}
h1 {
font-size: 2.441rem;
}This approach gives headings a predictable relationship with the base size instead of treating every heading as an unrelated number.
Modular Scale and rem Units
Using rem units is often preferable when building scalable typography because rem values are relative to the root font size. A modular scale can therefore be converted from pixel calculations into rem-based design tokens.
:root {
--font-size-base: 1rem;
--font-size-sm: 0.8rem;
--font-size-md: 1rem;
--font-size-lg: 1.25rem;
--font-size-xl: 1.5625rem;
--font-size-2xl: 1.953rem;
--font-size-3xl: 2.441rem;
}Modular Scales in CSS Custom Properties
CSS custom properties make it easy to centralize typography values. Instead of scattering font sizes throughout stylesheets, a project can define a small set of tokens and reuse them across components.
:root {
--text-sm: 0.8rem;
--text-base: 1rem;
--text-lg: 1.25rem;
--text-xl: 1.563rem;
--text-2xl: 1.953rem;
--text-3xl: 2.441rem;
}
.card-title {
font-size: var(--text-xl);
}
.page-title {
font-size: var(--text-3xl);
}Responsive Modular Scales
A fixed modular scale can become problematic on small screens. A large desktop heading may occupy several lines on a mobile device, increasing page height and reducing readability. Responsive typography can solve this by allowing values to change between viewport sizes.
The CSS clamp() function is particularly useful because it allows a font size to have a preferred fluid value while still enforcing minimum and maximum limits.
h1 {
font-size: clamp(2rem, 5vw, 4rem);
}This does not require the entire scale to remain mathematically identical at every viewport width. In practice, a design system can use a modular scale as a starting point and then apply responsive adjustments to preserve hierarchy and readability.
Choosing the Right Ratio
The best ratio depends on the type of interface being designed. A documentation website may benefit from a restrained scale, while a marketing page may use a stronger progression for large headings.
| Design Need | Possible Ratio |
|---|---|
| Dense application UI | 1.067–1.2 |
| General websites | 1.2–1.333 |
| Documentation | 1.2–1.333 |
| Editorial layouts | 1.25–1.5 |
| Large display typography | 1.414–1.618 |
These ranges are starting points rather than strict rules. Font characteristics, available width, line height and content density all affect how a scale looks in practice.
Modular Scale and Font Choice
The same numeric scale can look very different when applied to different typefaces. Fonts have different x-heights, character widths, weights and perceived sizes. A 32px heading in one font may appear substantially larger or smaller than a 32px heading in another.
For this reason, modular scale calculations should be evaluated visually with the actual fonts used by the project. Mathematical consistency is useful, but typography ultimately needs to be judged by how it reads and how it fits the interface.
Modular Scale and Line Height
Font size is only one part of typography. Line height should also be considered when applying a modular scale. Large headings often need tighter line heights, while paragraphs generally need more vertical space between lines.
body {
font-size: 1rem;
line-height: 1.6;
}
h1 {
font-size: 2.75rem;
line-height: 1.1;
}
h2 {
font-size: 2rem;
line-height: 1.2;
}Modular Scale and Spacing
The same idea can be applied beyond typography. Some design systems use related mathematical scales for spacing, component dimensions and other visual properties. This can create a consistent rhythm across an interface.
:root {
--space-1: 0.25rem;
--space-2: 0.5rem;
--space-3: 0.75rem;
--space-4: 1rem;
--space-5: 1.25rem;
--space-6: 1.563rem;
}Typography and spacing do not have to use the same ratio. In fact, separate scales are often more practical because text sizes and layout spacing have different functional requirements.
When a Modular Scale Should Not Be Followed Strictly
A modular scale is a design tool, not a requirement that every value must remain mathematically pure. Real interfaces contain constraints that a formula cannot understand, including navigation height, component dimensions, available screen width and accessibility requirements.
- Adjust heading sizes when they become too large on mobile screens.
- Round awkward decimal values for easier maintenance.
- Use smaller jumps when the interface contains dense information.
- Override scale values when a component has strict layout constraints.
- Prioritize readability over mathematical consistency.
Common Modular Scale Mistakes
Modular scales can simplify typography, but they can also create problems when used without considering real content and responsive layouts.
- Using a ratio that creates excessively large headings.
- Applying every generated scale step without a clear purpose.
- Ignoring mobile layouts.
- Using the same scale for every typeface without visual testing.
- Keeping excessive decimal precision in CSS values.
- Treating the scale as more important than readability.
- Changing individual values without documenting the resulting system.
Best Practices
- Choose a base font size that is comfortable to read.
- Start with a moderate ratio such as 1.2, 1.25 or 1.333.
- Generate several steps above and below the base value.
- Select only the steps that are useful for the interface.
- Convert values to appropriate CSS units such as rem.
- Use clamp() or media queries for responsive typography.
- Test the scale using real content and the actual project font.
- Document typography tokens in the design system.
- Adjust mathematically generated values when usability requires it.
Building a Simple Modular Typography System
A practical workflow starts with the project's base text size. Choose a ratio, generate a range of values, assign selected steps to semantic text styles and then test those styles across desktop and mobile layouts.
1. Choose base size
↓
2. Choose scale ratio
↓
3. Generate scale values
↓
4. Select useful steps
↓
5. Assign typography tokens
↓
6. Add responsive behavior
↓
7. Test with real contentFor example, a project might use 16px as its base and a 1.25 ratio, then define body text, small text and several heading levels from the generated values. The final values can be rounded and adjusted after testing the actual interface.
Example Typography Tokens
:root {
--font-size-xs: 0.8rem;
--font-size-sm: 0.875rem;
--font-size-base: 1rem;
--font-size-lg: 1.25rem;
--font-size-xl: 1.563rem;
--font-size-2xl: 1.953rem;
--font-size-3xl: 2.441rem;
}
body {
font-size: var(--font-size-base);
}
h3 {
font-size: var(--font-size-xl);
}
h2 {
font-size: var(--font-size-2xl);
}
h1 {
font-size: var(--font-size-3xl);
}Modular Scale vs Arbitrary Font Sizes
Arbitrary font sizes are not inherently wrong. Many mature design systems contain carefully chosen values that do not follow a strict mathematical progression. The main advantage of a modular scale is that it provides a logical starting point and makes the relationship between sizes easier to understand.
| Approach | Advantage | Potential Problem |
|---|---|---|
| Modular scale | Predictable relationships | May create impractical values |
| Arbitrary values | Flexible and precise | Can become inconsistent |
| Hybrid approach | Combines consistency and flexibility | Requires documentation |
For many projects, a hybrid approach works best. Use a modular scale to establish the initial hierarchy, then adjust individual values where design, accessibility or responsive behavior requires it.
Frequently Asked Questions
What is a modular scale in typography?
A modular scale is a sequence of related font sizes generated from a base value and a consistent ratio. It helps create predictable visual hierarchy between body text, headings and other text styles.
What is a good modular scale ratio for websites?
Ratios around 1.2, 1.25 and 1.333 are common starting points for general web typography. The best choice depends on the type of website, font and desired visual hierarchy.
Should every heading use a modular scale step?
No. A scale provides a set of possible values. A design system should select the steps that are useful for its content and adjust them when necessary for readability and layout.
Can modular scales be used with responsive typography?
Yes. A modular scale can define the underlying hierarchy while CSS techniques such as clamp() adjust font sizes between minimum and maximum values as the viewport changes.
Should modular scale values use px or rem?
rem is often useful for scalable typography because values are relative to the root font size. However, the appropriate unit depends on the project's typography strategy and requirements.
Is the golden ratio good for typography?
The golden ratio creates a strong progression between sizes. It can work well for expressive display typography, but it may create headings that are too large for dense interfaces or smaller screens.
Do all fonts work with the same modular scale?
The same numerical scale can be applied to different fonts, but the visual result will vary because typefaces have different proportions and perceived sizes. Always test the scale with the actual font being used.
Helpful Typography Tools
A Modular Scale Calculator generates related values from a base size and ratio, while a Typography Scale Generator helps create a complete set of text sizes for an interface. A CSS Clamp Generator can turn fixed typography values into responsive clamp() expressions, a CSS Unit Converter helps convert between common CSS units, and a px ↔ rem Converter makes it easier to translate pixel-based scale values into rem units.
Conclusion
A modular scale provides a simple mathematical foundation for creating consistent typography. By combining a base size with a ratio, designers and developers can generate related font sizes instead of choosing every value independently. Common ratios such as 1.2, 1.25 and 1.333 can provide balanced hierarchies, while larger ratios create stronger visual differences.
The most effective modular typography systems are not blindly mathematical. They use the scale as a starting point, then adapt values to the chosen font, content, responsive layouts and accessibility requirements. When combined with rem units, CSS custom properties and responsive techniques such as clamp(), modular scales can provide a practical foundation for maintainable and consistent web typography.