A modular type scale sets each font size by multiplying a base size by one ratio per step, so a 16px base on a ratio of 1.25 gives 20px, then 25px. Designers often round the sizes to a grid, and that is where steps disappear. We generated 936 pairs of neighbouring sizes from the 13 named ratios on bases of 12 to 20px, two steps down and six up, at a 16px root. Rounded half up to 0.25rem, which is 4px at that root, 100 of the 936 pairs landed on the same size. Kept to two decimals, none did. Many sizes sit exactly halfway between grid values, so a different tie rule moves the count to 103 or 104. This is token rounding by the designer; the browser does none of it. Whether two neighbours can merge comes down to one number, the grid divided by the ratio minus one.
Steps closer together than the grid can sound as one note
Two neighbours differ by the smaller size times the ratio minus one. Rounding can send both to one grid value only while that gap is under the grid, so a merge is possible below a size of grid ÷ (ratio − 1) and impossible above it. Our thresholds for five presets:
| Ratio | Whole px | 0.125rem (2px) | 0.25rem (4px) |
|---|---|---|---|
| Minor second, 16:15 | 15px | 30px | 60px |
| Major second, 9:8 | 8px | 16px | 32px |
| Major third, 5:4 | 4px | 8px | 16px |
| Perfect fourth, 4:3 | 3px | 6px | 12px |
| Octave, 2:1 | 1px | 2px | 4px |
A minor second on a 4px grid can therefore merge steps anywhere under 60px, the top of its default range included. Rounding half up, on whole pixels only 1 of the 936 pairs merged, a minor second on a 12px base. On 0.125rem it was 34, of which 28 were minor seconds. On the 4px grid the minor second supplied 51 of the 100 and the major second 27. Every ratio from the perfect fourth up contributed three pairs or fewer. Rounding moves the base too: on the 4px grid a 14px base becomes 16px.
The narrowest ratio plays nine tokens on a handful of notes
A revision of our type scale calculator dated 6 November 2026 adds a "Round sizes to" control, from 0.5px up to 0.25rem. It rounds half up, shades rows that share a size and states the threshold. Before that revision the calculator showed only unrounded sizes and never warned that a grid could collapse them, and its FAQ credited Tim Brown's 2011 article with making the musical names common among web designers.
To re-run the example, set a 16px base, the Minor Second preset, six steps up, two down and 0.25rem rounding. The table reads 16, 16, 16, 16, 20, 20, 20, 24, 24: nine tokens on three sizes, with the threshold at 60px. Switch to 0.125rem and the sizes become 14, 16, 16, 18, 18, 20, 20, 22, 24. Three pairs share a size there: sm with base, lg with xl, and 2xl with 3xl.
Rounding detunes the ratio even where every step stays distinct
A scale that keeps all nine sizes can still lose its ratio. On the defaults, a 16px base and the Major Third, whole-pixel rounding gives 10, 13, 16, 20, 25, 31, 39, 49, 61. Nothing merges, yet each step now runs anywhere from 1.231 to 1.300 instead of a steady 1.25.
A perfect fourth rounded to 0.25rem steps by 1.250 at its narrowest and 1.500 at its widest. On the 4px grid the golden ratio's two smallest tokens, xs and sm, both round to 8px, and the next step jumps to 16px, so a scale labelled 1.618 contains one step of exactly 1 and another of exactly 2.
Just intonation tunes most of the presets
The preset values, and most of their names, come from modularscale-sass, the MIT-licensed library by Scott Kellum, Adam Stacoviak and Mason Wendell. Its variables carry names such as $minor-second. The calculator uses the library's ratios up to the octave, 13 of its 19.
Ten of those thirteen are whole-number frequency ratios from just intonation, and all ten appear in the Huygens-Fokker Foundation's "List of intervals", compiled by Manuel Op de Coul, sometimes under other names: 16:15 is the "minor diatonic semitone" there and 15:8 the "classic major seventh". The other three need care. The list gives 16:9 as the Pythagorean minor seventh, with 9:5 as the just one. The augmented fourth preset is √2, the equal-tempered tritone. The golden ratio is no musical interval at all.
The web idea is usually traced to Brown's More Meaningful Typography, A List Apart issue 327, dated 3 May 2011, which defines a modular scale as "a sequence of numbers that relate to one another in a meaningful way". His example works in the golden ratio, he credits Robert Bringhurst's The Elements of Typographic Style, and the article names no musical interval.
A fluid clamp() size goes flat at 200% zoom
WCAG 2.2 success criterion 1.4.4, explained in Understanding Resize Text, asks that text can be resized up to 200 percent without assistive technology. MDN's font-size page notes that the browser default is usually 16px, and that users cannot change px sizes in some browsers. For viewport units, the W3C technique F94 explains that they "cannot be resized by zooming or adjusting text-size".
We modelled clamp(1rem, 2vw + 0.5rem, 1.5rem) at viewport widths of 320 to 2,560 CSS pixels, under 200% page zoom and under a 32px browser font setting. Either way the text doubled only at 400px and below or at 1,600px and above. At 800px it grew just 1.33 times, from 24px to 32px, because the unzoomed size already sits at the 1.5rem cap there. At 1,280px it grew 1.73 times. This is arithmetic on one expression, run in no browser, and no conformance verdict.
Browser default headings change key from level to level
The WHATWG HTML rendering section, under "Sections and headings", sets h1 to h6 at 2.00, 1.50, 1.17, 1.00, 0.83 and 0.67em. The step from h1 to h2 is exactly 4:3, and the smallest jump, 1.170, falls between h3 and h4. A single ratio fitted to all six sizes, anchored at h4, comes out at 1.237 by our calculation. The nearest preset is the major third, which, scaled from a 16px h4, misses by at most 6.8%, at h3: 20px against 18.72px.
Under the decimals our arithmetic finds a plainer pattern. To two places the six sizes equal 12, 9, 7, 6, 5 and 4 sixths of an em, a ladder that counts down instead of multiplying. We make no claim about how the values were chosen.
The ladder has also moved. The informative default style sheet in CSS 2.1 Appendix D, a W3C Recommendation of 7 June 2011, gives h6 at .75em and sets no h4 size, which shrinks the last step to 1.107. In July 2025 WHATWG merged pull request 11102, removing the smaller sizes once given to an h1 nested in article, aside, nav or section. Which engines ship each change, the specification does not say.