Free, independent guides since 2010

Design

Typography for the web: readable text that looks good

Practical web typography: choosing and pairing fonts, font size and line height, line length, hierarchy with headings, spacing and readability on mobile.

<guide section="Design" type="article" read="1 min"/>

Most of a website is text. Good typography makes that text effortless to read; bad typography makes visitors leave without knowing why. These are the rules we apply on this site.

Choosing fonts

  • Pick a body font that is highly readable at small sizes.
  • Optionally add a second font for headings or interface labels – with a clearly different role.
  • Check language support: accents, euro sign, quotes and dashes.
  • Load fonts efficiently – see web fonts.

Size, line height and line length

SettingGood starting point
Body size16–20 px (1–1.25 rem)
Line height1.5–1.7 for body text, 1.1–1.25 for headings
Line length50–75 characters
Paragraph spacingAbout one line of space
CSS
body { font-size: 1.1rem; line-height: 1.7; }
.prose { max-width: 68ch; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.1; }

clamp() scales headings smoothly between a minimum and maximum size.

Hierarchy

  • Use a clear type scale: each heading level noticeably different.
  • Weight and space separate sections as much as size does.
  • Keep headings short, and in a consistent case style (we use sentence case).

Readability details

  • Left-aligned text reads better than justified text on the web.
  • Avoid light grey text on white: check contrast with our contrast checker.
  • Use real quotes (“ ”), apostrophes (’) and dashes (–).
  • Break long texts with subheadings, lists and tables.

Frequently asked questions

Serif or sans-serif for body text?

Both work well on modern screens. Choose based on the character of your brand and the font’s readability at small sizes. This site uses a slab serif for body text.

Should I use all caps for headings?

Sparingly. Short labels in capitals with extra letter spacing can work, but long headings in capitals are harder to read.