Why a modular type scale removes guesswork from heading sizes
Picking font sizes by instinct—28px on one card, 31px on another, 19px on a modal title—quickly creates visual drift across a growing product. Even when users cannot name what feels off, inconsistent heading steps weaken scannability and force designers and engineers to debate arbitrary pixel tweaks in every code review.
A modular type scale solves this with one mathematical anchor: start from a comfortable base body size (typically 16px) and multiply upward or divide downward by a consistent geometric ratio such as Major Third (1.25) or Perfect Fourth (1.333). Every heading, subheading, body paragraph, and caption automatically locks into a recognizable proportional rhythm.
This free type scale calculator unlocks all eight classic musical and architectural ratios with zero paywalls, pairs each step with an optical line-height recommendation, previews the entire ladder in real UINice design system colors, and exports clean CSS custom properties or Tailwind v4 @theme font-size tokens in one click.
How to calculate and export your typography scale in four steps
- Set your Base Body Size—16px is the web standard for accessible reading, while dense dashboards often start at 14px or 15px and long-form editorial blogs sometimes step up to 17px or 18px.
- Pick one of the eight modular scale ratios from the dropdown, comparing tighter utilitarian ratios (1.125–1.200) against expressive marketing ratios (1.333–1.618) live in the specimen ladder.
- Choose rem or px output units and tune Heading Weight while checking legibility across UINice design system surface palettes.
- Toggle between standard CSS :root custom properties and Tailwind v4 @theme font-size tokens (complete with paired line-height variables), then copy the ready-to-commit stylesheet block.
Choosing the right modular scale ratio for your product type
No single ratio fits every interface. Dense data applications need gentle size jumps so headers do not crowd tables, whereas editorial homepages and launch sites thrive on dramatic scale contrast between display titles and body copy:
- 1.067 Minor Second & 1.125 Major Second: Compact, disciplined steps suited to dense SaaS dashboards, admin panels, spreadsheets, and mobile-first utilities where screen height is precious.
- 1.200 Minor Third & 1.250 Major Third: The versatile all-rounders for modern web apps, documentation portals, and responsive marketing sites that look balanced on both phones and laptops.
- 1.333 Perfect Fourth & 1.414 Augmented Fourth: Confident editorial contrast ideal for SaaS landing pages, portfolios, and product launches with bold hero statements.
- 1.500 Perfect Fifth & 1.618 Golden Ratio: Dramatic theatrical jumps reserved for widescreen magazines, luxury storefronts, and poster-style hero sections—pair with a tighter ratio on small screens.
Why rem units and paired line-heights matter in real CSS
Exporting your type scale in rem units respects each visitor's browser default font-size preference, which is essential for users with low vision who increase system text size from 16px to 20px or 24px. Because 1rem equals the root font size, every heading and caption scales proportionally without breaking your modular harmony.
Equally important is tightening line-height as text grows larger. Body copy at 16px reads smoothly around 1.55 line-height, yet a 50px hero title at 1.55 leaves awkward rivers of empty space between wrapped lines. This calculator pairs display steps (3xl–5xl) with tight 1.12 leading, subheadings (xl–2xl) with 1.24, and body text with comfortable 1.55 leading automatically.
Adapting one type scale smoothly between mobile and desktop
A wide ratio like Perfect Fourth (1.333) looks commanding on a 1440px monitor where 5xl reaches roughly 67px, yet that same 67px headline can wrap awkwardly into five short lines on a 375px smartphone. The cleanest responsive pattern keeps the exact same token names (--text-base through --text-5xl) while stepping down one ratio notch on small screens—for example Major Second (1.125) or Minor Third (1.200) on phones and Major Third (1.250) or Perfect Fourth (1.333) on desktop.
In Tailwind v4, defining --text-<token> and --text-<token>--line-height inside @theme binds both size and leading into a single utility class such as text-3xl, keeping components concise and consistent across large engineering teams.
Resist the temptation to invent one-off intermediate sizes like 17px or 23px when a card feels slightly off—instead adjust spacing, font weight, letter-spacing, or color contrast first. Keeping your active scale to six or eight disciplined steps makes every screen immediately recognizable as part of the same product.
Bring your type scale into a complete design system
Typography hierarchy shines brightest when paired with deliberate font pairing, verified WCAG color contrast, and predictable spacing multiples across cards, forms, and navigation landmarks. Once your scale tokens live cleanly in CSS variables or Tailwind v4 theme definitions, every new landing page and product dialog inherits balanced proportions automatically.
Click the UINice design system link below the color presets to explore production interfaces built with harmonious type scales, curated palettes, and cohesive component libraries ready to inspire your next release.
Pairing your modular type scale with explicit font-weight tokens (400 for body paragraphs, 500 for navigation and form labels, 600 for buttons and card titles, and 700 or 800 for display headlines) gives every page clear rhythm without relying solely on giant headline sizes. Export your verified scale once, commit it to your shared CSS tokens, and build every new feature on a dependable typographic foundation that scales smoothly from mobile screens to desktop monitors.
Questions
Are all modular type scale ratios free to export to Tailwind v4?
Yes. Every ratio from 1.067 Minor Second through 1.618 Golden Ratio is completely free to preview and export in both CSS variables and Tailwind v4 @theme syntax.
Should I export my type scale in rem or px?
Use rem for production websites so text honors browser accessibility font-size settings. Use px when handing exact pixel specs to design tools or fixed-size graphics.
Which modular ratio is the safest default for a responsive SaaS web app?
1.200 Minor Third or 1.250 Major Third offer clear visual hierarchy across headings and cards without making top-level titles oversized on mobile viewports.
Why does Tailwind v4 export include --line-height tokens?
Tailwind v4 reads paired --text-<name>--line-height variables inside @theme so every text size utility automatically applies an optically matched line-height.