Sub topic 3
Line length: the measure
Prerequisites
This chapter assumes you know what a font size is and can read basic HTML and CSS. You do not need to know anything about leading yet. The next chapters cover it. Here the focus is line length, which typographers call the measure.
What the measure is
The measure is the width of a column of text. You can count it in characters, in words, or in a physical or screen unit such as millimetres, pixels, or ems. Typographers prefer characters per line (CPL), because the number of characters a reader's eye must cross in one sweep is what drives comfort. A column that is 600 pixels wide holds very different numbers of characters depending on the font and size.
Two points about counting:
- Count spaces and punctuation. Most guidelines include them.
- Count a typical line, not the longest or shortest. Lines in a ragged-right paragraph vary, so take an average over several lines.
Why the measure affects reading
Reading is not a smooth glide. The eye makes short jumps called saccades and pauses between them. At the end of each line the eye must sweep back to the start of the next one. That return sweep is where the measure matters.
- Lines that are too long. The return sweep is long and the angle is shallow. The eye can land on the wrong line, so the reader re-reads or skips a line. Reading also tires faster, because the reader loses track of the position in the text.
- Lines that are too short. The eye makes a return sweep every few words. The reading rhythm breaks up. Short columns also force more awkward word spacing or hyphenation in justified text, and the text feels choppy.
The diagram shows the cycle for a single line.
Commonly cited ranges
The most widely quoted guideline is a range of about 45 to 75 characters per line for body text in a single column, with 66 characters often named as an ideal. This comes from long print tradition, and Robert Bringhurst's The Elements of Typographic Style is the usual source for it. Treat these numbers as a starting point for your own judgment, not as a law. Studies of on-screen reading give mixed results, and the best value depends on the reader, the content, and the device.
| Situation | Typical range (characters per line) | Notes |
|---|---|---|
| Single-column body text | 45 to 75 | 66 is a common target |
| Narrow columns (sidebars, captions) | 35 to 45 | Keep text short and left-aligned |
| Multi-column layouts | 40 to 50 | Columns this narrow suit newspaper-style text |
| Long-form reading on a large screen | 60 to 75 | The upper end suits generous leading |
Some readers do better outside these ranges. Skilled readers cope with slightly longer lines. People with some reading difficulties often do better with shorter ones. Accessibility guidance (WCAG success criterion 1.4.8, a Level AAA criterion) suggests that a block of text should not be wider than 80 characters. Level AAA criteria are the strictest tier, so many sites do not meet them, but 80 is a useful ceiling.
Measuring characters per line
You rarely need to count exactly. Two quick methods work well.
- Count a sample. Pick a full line from the middle of a paragraph and count its characters, including spaces. Do this for three or four lines and average them.
- Use the alphabet trick. Set the lowercase alphabet,
abcdefghijklmnopqrstuvwxyz, in your font at your size. It has 26 characters. If it fits about two and a half times across your column, you have roughly 65 characters per line. This is approximate, because real text has narrower letters and more spaces than the alphabet does.
You can also check from the browser. This script prints the average characters per line of a paragraph by splitting its text into the lines the browser actually rendered:
function charsPerLine(paragraph) {
const textNode = paragraph.firstChild;
const text = textNode.textContent;
const range = document.createRange();
const lines = [];
let lineStartIndex = 0;
let lastTop = null;
for (let i = 0; i < text.length; i++) {
range.setStart(textNode, i);
range.setEnd(textNode, i + 1);
const rect = range.getBoundingClientRect();
if (rect.height === 0) continue; // skip collapsed whitespace
if (lastTop !== null && Math.abs(rect.top - lastTop) > 2) {
lines.push(text.slice(lineStartIndex, i).trim());
lineStartIndex = i;
}
lastTop = rect.top;
}
lines.push(text.slice(lineStartIndex).trim());
const lengths = lines.map((line) => line.length);
const average = lengths.reduce((a, b) => a + b, 0) / lengths.length;
return { lines: lengths, average: Math.round(average) };
}
console.log(charsPerLine(document.querySelector("p")));Run it in the browser console on a paragraph that contains a single text node. It will not work as written on a paragraph with inline elements such as <a> or <em>, because firstChild is then only the first piece of text.
Setting the measure in CSS
The unit ch equals the width of the digit "0" in the element's font. In most fonts the average letter is a little narrower than "0", so 65ch usually holds somewhat more than 65 characters of running text. That is fine for a guideline range, and it is why ch is the standard unit for a measure.
body {
font-size: 1rem;
line-height: 1.5;
}
p {
max-width: 65ch;
}Use max-width, not width. A max-width lets the paragraph shrink on a narrow screen and caps its length on a wide one. A fixed width would overflow a small viewport.
Because ch is relative to the element's own font, the measure follows font changes automatically. If a caption uses a smaller size, 45ch of caption text is physically narrower than 45ch of body text, and it still holds about the same number of characters.
Common errors
- Setting the width on the wrong element. If you put
max-width: 65chonbodyand setbodyto a large font size, then give paragraphs a smaller size, thechis calculated from the body font. Paragraphs end up longer than you intended. Set themax-widthon the element whose font you are measuring. - Using pixel widths.
max-width: 600pxgives a different character count at every font size. When a user raises their default font size, the line gets shorter in characters. Usechoremso the measure scales with the text. - Capping the wrong container. If a wrapper
divhasmax-width: 65chbut the wrapper's font is larger than the paragraph's, the paragraph holds more characters than expected. Keep the wrapper and the text in the same font size, or set the cap on the paragraph. - Forgetting other content. A
max-widthon everypleaves lists, blockquotes, and tables uncapped. Long list items can then run past the intended measure.
The following rule caps text blocks that readers will read as prose, and leaves wide elements such as tables and code blocks free:
.article p,
.article ul,
.article ol {
max-width: 65ch;
}
.article pre,
.article table {
max-width: 100%;
overflow-x: auto;
}Edge cases
- Justified text. Narrow justified columns create uneven gaps between words, sometimes called rivers. If you must justify, use a wider measure and turn on hyphenation with
hyphens: autoand a correctlangattribute on the page. - Languages with longer words. German and Finnish have long compound words. A measure that suits English may break badly. Check real text in the real language.
- Languages with other scripts. Chinese, Japanese, and Korean text has no word spaces and uses square characters. The guideline is counted in characters, and common values are lower, around 25 to 40 characters per line. Treat the English range as not applicable.
- Headings. Large headings need a shorter measure than body text, because their larger size makes each line physically long. A cap in
chon the heading scales with its size. - Very large screens. Without a cap, text spreads across the whole window. The
max-widthcap keeps it readable, and you can center the column withmargin-inline: auto.
Summary of the working model
The measure is the number of characters a reader's eye crosses before sweeping back. A comfortable range for body text is about 45 to 75 characters, with a target near 66. In CSS, set max-width in ch on the paragraph, and let the measure follow the font. The next chapters turn to leading, and later to how the two settings depend on each other: a longer line usually needs more space between lines to let the eye find its way back.
Exercise
A paragraph has font-size: 1.25rem and sits inside a wrapper with max-width: 70ch. The wrapper itself uses font-size: 1rem. Will the paragraph hold roughly 70 characters per line, more, or fewer? Explain, and say how you would fix it.
Show answer
It holds more. The ch unit is computed from the wrapper's font size (1rem), so the wrapper is as wide as 70 "0" characters at 1rem. The paragraph text is larger (1.25rem), so each character is wider and fewer characters fit: about 56 characters (70 divided by 1.25). So the paragraph holds fewer characters, not more. To fix it, put the cap on the paragraph itself (p { max-width: 70ch; }), so ch uses the paragraph's own 1.25rem font. Alternatively, keep the wrapper and paragraph at the same font size.
Exercise
You measure five lines of a paragraph and count 82, 79, 85, 80, and 84 characters. Is this within the commonly cited range, and what single CSS change would you try first?
Show answer
The average is (82 + 79 + 85 + 80 + 84) / 5 = 82 characters per line. That is above the commonly cited 45 to 75 range and above the WCAG AAA ceiling of 80. Try setting max-width: 65ch on the paragraph (a value between 60ch and 70ch also works), then recount to confirm the lines now fall near 60 to 75 characters.
Exercise
Why is max-width: 600px a weaker way to set the measure than max-width: 65ch?
Show answer
A pixel width gives a different number of characters at each font size. If a reader raises their browser's default font size, a 600px column holds fewer characters per line, and if a designer lowers the size, it holds more. A ch width is tied to the font, so the character count stays roughly the same as the text size changes.