CSS typography styler — readable body text with system font stacks

Choose one of eight system font stacks and tune size, line height, weight, spacing and line length on sample text, then copy a ready .prose rule that needs no web font download.

Live demo · real result from this tool

Press Generate to create a result.

Processed on your device — nothing is uploaded.

How to use the CSS typography styler

  1. Choose a Font stack, for example System UI, Old-style serif or Monospace code.
  2. Set Font size, Line height, Weight and Letter spacing.
  3. Set Max line length in ch, and a Text transform if needed.
  4. Pick a Text colour and paste your own copy into Sample text to judge it on real words.
  5. Copy the .prose rule and apply the class to your article or content area.

What it does and when to use it

Body text is what people spend most time reading, and small changes in spacing and line length make a large difference to comfort. This tool is for setting that base style: blog posts, documentation, help pages, or the paragraph style of a design system. The preview shows your settings on a full paragraph rather than a single line, which is where problems with tight lines or long measures become visible.

To build matching heading sizes, use the type scale generator. To convert other sizes in your stylesheet, use the px to rem converter, and check the text colour with the contrast checker.

How it works

The output contains font-family, font-size in rem (pixels ÷ 16), font-weight, a unitless line-height, max-width in ch and color. letter-spacing is added only when it is not zero, in em so it scales with the text, and text-transform only when it is not “none”. Every font in the stacks is a system font, so nothing is downloaded. MDN lists font-family and line-height as Baseline widely available since July 2015.

Worked examples

The default. System UI at 18px, line height 1.6, 65ch:

font-size: 1.125rem; /* 18px */
font-weight: 400;
line-height: 1.6;
max-width: 65ch;

A bookish article. Old-style serif, 20px, line height 1.7, 60ch gives font-family: "Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052, serif; with font-size: 1.25rem; /* 20px */.

Small capital labels. Neo-grotesque, 13px, weight 600, line height 1.3, letter spacing 0.08em and uppercase add letter-spacing: 0.08em; and text-transform: uppercase;. Capitals sit tightly by default, so a little extra spacing helps short labels.

Limits and tips

  • Font size is clamped to 6–96px and the slider runs 10–32px; this tool is meant for body text, not display headings.
  • Thin weights look fainter than their contrast ratio suggests. Weight 300 in pale grey is hard to read even when the colours pass.
  • Keep uppercase for labels and short headings. Whole paragraphs in capitals lose the word shapes readers rely on.

Frequently asked questions

Where do the font stacks come from?
From Modern Font Stacks (modernfontstacks.com), a CC0 project that lists fonts already installed on common operating systems. Each stack names several similar fonts and ends with a generic family such as serif, so something close always shows.
Will the text look the same on every device?
Close, not identical. For the Transitional serif stack, a Mac may use Charter while Windows uses Sitka Text or Cambria. If an exact typeface matters, load a web font, at the cost of a download.
Why is the font size in rem?
rem follows the reader's browser font setting, so people who raise their default size get bigger text. The tool divides your pixel value by 16 and keeps the pixel size in a comment.
Why does line height have no unit?
A unitless line height such as 1.6 is a multiplier of each element's own font size, so nested headings or small print inherit a sensible spacing instead of a fixed pixel gap.
What does the ch unit in max-width mean?
One ch is the width of the zero character in the current font, so 65ch is roughly 65 characters of average text. It keeps line length steady when the font size changes.

Sources

  1. font-family - CSS | MDN — MDN Web Docs, accessed 2026-10-08
  2. line-height - CSS | MDN — MDN Web Docs, accessed 2026-10-08

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close