Free Modular Scale Generator
Build harmonious typographic scales and systematic spacing grids using musical intervals and classic ratios
Modular Scale Generator
Scale Preview
Predefined Scales:
Generated Scale Values
| Step | Description | PX Value | REM Value | EM Value | Ratio Step |
|---|
CSS Code Output
Tailwind Configuration
{
"fontSize": {}
}The Power of Modular Scales in Design Systems
A modular scale is a sequence of numbers that relate to one another through a repeated mathematical ratio. Used by typographers and layout engineers, it creates natural visual hierarchies and spacing systems. Instead of selecting font sizes and margins arbitrarily, modular scales ensure that every dimension in your application has a calculated, harmonious relationship with standard base constraints.
The Modular Scale Scaling Formula
To find any step up or step down value on a scale, multiply the base screen value (such as 16px) by the chosen scale ratio raised to the power of the target step index:
Scale Value = Base Size × RatioStep
If your base body text size is **16px** and you use a **1.5 (Perfect Fifth)** scaling factor:
Step 0: 16 × 1.5⁰ = 16.00px (Body Base)
Step 1: 16 × 1.5¹ = 24.00px (Subheadings)
Step 2: 16 × 1.5² = 36.00px (Titles)
Step 3: 16 × 1.5³ = 54.00px (Hero Text)
Harmonious Design Ratios Reference Table
Compare common proportions based on geometry, musical scales, and standard mathematical constants:
| Scale Ratio Name | Decimal Value | Mathematical Origin | Visual Feel / Personality |
|---|---|---|---|
| Minor Second | 1.067 | 16:15 ratio | Extremely compact (ideal for high-density dashboards) |
| Major Second | 1.125 | 9:8 ratio | Subtle progression (highly modern, clean interface jumps) |
| Perfect Fourth | 1.333 | 4:3 ratio | Balanced, classic (standard readable book sizes) |
| Perfect Fifth | 1.500 | 3:2 ratio | Bold contrast (strong separation between tags and titles) |
| Golden Ratio | 1.618 | φ (Phi) constant | Classic harmony (natural visual balance) |
| Octave | 2.000 | 2:1 ratio | Dramatic leaps (massive header highlights) |
Generating CSS Variable Blocks
Export scales directly into custom stylesheet declarations. Adjust the base body font at breakpoints to keep scales responsive:
--base-size: 1rem;
--ratio: 1.333;
--text-sm: calc(var(--base-size) / var(--ratio)); /* 0.75rem */
--text-md: var(--base-size); /* 1rem */
--text-lg: calc(var(--base-size) * var(--ratio)); /* 1.333rem */
--text-xl: calc(var(--text-lg) * var(--ratio)); /* 1.777rem */
}