Typography Scale Generator
Generate a harmonious type scale with modular ratios. Preview sizes, then export to CSS, Tailwind, or SCSS.
How to Use the Typography Scale Generator
- Set the base size — this is your body text size, typically 16px (the browser default).
- Choose a scale ratio — pick from 8 modular ratios ranging from subtle (Minor Second) to dramatic (Golden Ratio).
- Configure steps — set how many sizes above and below the base you need. 6 above and 2 below covers most designs (3xl down to xs).
- Preview the scale — see actual rendered text at each size with the font family you specified.
- Export — copy the generated code as CSS custom properties, Tailwind config, or SCSS variables.
What Is a Modular Typographic Scale?
A modular typographic scale is a sequence of font sizes where each size is derived by multiplying the previous one by a fixed ratio. This approach creates a mathematically harmonious progression of sizes, much like the intervals between notes in a musical scale. The concept was popularized by Robert Bringhurst in "The Elements of Typographic Style" and has become a cornerstone of modern web typography.
Choosing the Right Ratio
The ratio you choose depends on your design context. For interfaces and applications, a smaller ratio like Minor Third (1.2) or Major Third (1.25) provides subtle, functional size differences. For editorial content and marketing pages, Perfect Fourth (1.333) or Perfect Fifth (1.5) creates more dramatic hierarchy. The Golden Ratio (1.618) is the most dramatic and is best for art-directed, high-impact designs.
The Base Font Size
The base font size is the anchor of your typographic scale. On the web, 16px is the universal default and provides comfortable reading on screens. Some designers prefer 18px for content-heavy sites where readability is paramount. The base size becomes the reference point: all other sizes are calculated relative to it, either multiplied upward for headings or divided downward for small text and captions.
Using rem Units
The generator shows sizes in both px and rem. Using rem units in your CSS is recommended because they scale relative to the root font size, making your typography responsive and accessible. When users adjust their browser's default font size (for accessibility), rem-based typography scales proportionally, while px-based values stay fixed.
Naming Conventions
The generated scale uses a standard naming convention: xs and sm for small text, base for body text, and lg through 6xl for increasingly larger sizes. This convention maps naturally to HTML heading levels (h1 through h6) and utility class systems like Tailwind CSS.
Applying the Scale
Once you have your scale, apply it consistently across your project. Map the largest sizes to h1 and h2, medium sizes to h3 and h4, and the base to body text. Use the smaller sizes for captions, labels, and fine print. Consistency in type sizing creates a clear visual hierarchy that guides readers through your content.
Responsive Typography
A typographic scale that looks perfect on desktop may not work on mobile screens. Large headings can overflow or dominate small viewports. Consider using CSS clamp() to create fluid typography that scales between viewport sizes, or generate separate scales for mobile (using a smaller ratio like Minor Second) and desktop (using a larger ratio like Perfect Fourth). Many design systems use a tighter scale at smaller breakpoints and expand to a more dramatic scale on wider screens.
Line Height and Spacing
Font size is only one part of a typographic system. Line height (leading), letter spacing (tracking), and margin between elements all contribute to readability and visual rhythm. As a general rule, body text works well with a line height of 1.5 to 1.7, while headings look best with tighter line heights of 1.1 to 1.3. Once you have your size scale, apply consistent vertical spacing using your scale values as a reference — for example, set paragraph margins to your base size or half your base size for a cohesive rhythm. Pair your type scale with a harmonious Color Palette, create brand icons with the Favicon Generator, or preview your typography in rendered Markdown with the Markdown Preview.