Sub topic 13
Word Spacing and How It Relates to Tracking
This chapter assumes you know the basics from earlier chapters. You should know what sidebearings, kerning, and tracking are. You should also be able to read simple CSS and convert tracking units in thousandths of an em to CSS em values. Here the focus moves from the gaps between letters to the gaps between words.
The space is a glyph
A word space is not empty layout. It is a glyph in the font, usually U+0020, and it has an advance width like any other glyph. Most text fonts set that width between about 0.2 em and 0.33 em. At 16 px, that is roughly 3 to 5 px. A font designer chooses the width so that, with the font's normal sidebearings, words read as separate units without leaving holes in the line.
A font's space glyph has no visible shape, so it has no meaningful sidebearings. Its advance width alone defines the gap. The visible gap between two words is therefore:
- the right sidebearing of the last letter of the first word,
- plus the advance width of the space glyph,
- plus the left sidebearing of the first letter of the next word.
This is why a word gap looks larger after a letter such as "o" than after a flat-sided "l". The sidebearings differ even though the space is the same. Kerning pairs involving the space glyph exist in some fonts, but they are rare and small. Most of the time you can treat the space as a fixed block of width.
Word spacing versus tracking
Tracking changes the space after every character in a run. Word spacing changes the space only at word separators. A word separator is mainly the space character. In CSS it also includes the no-break space (U+00A0) and a few other separator characters.
This difference matters because tracking does not skip spaces. When you set letter-spacing: 0.1em, the browser adds 0.1 em after each character. That includes the space, so every word gap grows by 0.1 em too. Loosening tracking therefore always opens word gaps as a side effect, and tightening tracking always closes them.
| Control | What it changes | Applies to spaces | Typical use |
|---|---|---|---|
| Kerning | Space between one specific pair | Rarely | Fixing awkward pairs such as AV or To |
| Tracking (`letter-spacing`) | Space after every character | Yes | Opening all-caps labels, tightening large headlines |
| Word spacing (`word-spacing`) | Space after word separators only | Only separators | Rebalancing word gaps after tracking or in justified text |
The two properties in CSS
word-spacing takes a length and adds it to the default advance of each word separator. A positive value widens word gaps. A negative value narrows them. Use em units so the value scales with the font size, as you do with letter-spacing.
.tight-headline {
font-size: 4rem;
letter-spacing: -0.02em;
word-spacing: -0.04em;
}
.spaced-label {
font-size: 0.75rem;
text-transform: uppercase;
letter-spacing: 0.12em;
word-spacing: 0.1em;
}The CSS specification also allows percentage values for word-spacing, relative to the width of the affected character. Browser support has been uneven, so em lengths are the safer choice.
Because letter-spacing already acts on the space, the effective extra width at a word gap is the sum of both properties. You can check this with a small calculation. The function below returns the width of a word gap in em, excluding the sidebearings of the neighboring letters.
function wordGapEm(spaceAdvance, letterSpacing, wordSpacing) {
return spaceAdvance + letterSpacing + wordSpacing;
}
// A font with a 0.25em space, set with tracking of 120/1000 em
console.log(wordGapEm(0.25, 0.12, 0).toFixed(2)); // "0.37"
console.log(wordGapEm(0.25, 0.12, 0.1).toFixed(2)); // "0.47"
console.log(wordGapEm(0.25, -0.02, -0.04).toFixed(2)); // "0.19"Run this with Node.js or a browser console. The first line shows that tracking alone widens the gap from 0.25 em to 0.37 em, even though you never touched word spacing.
Why tracked text often needs extra word spacing
What the reader perceives is the ratio of the word gap to the letter gaps, not the absolute gap. If letter gaps are narrow and word gaps are wide, words are clear. If both are widened by the same amount, the ratio shrinks and words begin to merge into one string.
Take a font with a 0.25 em space and letter gaps of about 0.05 em. The word gap is five times the letter gap. Add 0.12 em of tracking. The letter gap becomes 0.17 em and the word gap becomes 0.37 em. The ratio falls to about 2.2. The text still reads, but the words are less distinct.
This is most visible in tracked all caps. Capitals have no ascenders or descenders to give each word a distinctive outline, so they depend more on the gap. A small positive word-spacing, often 0.05 em to 0.2 em, restores the separation. Judge by eye. The right value depends on the font and the amount of tracking.
The reverse case is a large headline with tight tracking. At 4 rem, a 0.25 em space is 16 px wide. Tracking of -0.02 em narrows it only slightly. Large display text often looks gappy between words even after the letters are tightened, so a negative word-spacing of around -0.03 em to -0.08 em can help. Reduce it only until the line reads as a single phrase, and stop before words touch.
Word spacing in body text and justified text
For left-aligned body text, leave word-spacing at its default. The type designer set the space width for the font's normal rhythm, and the font is already tuned to it. Changing it for long reading text adds uneven rhythm and rarely helps.
Justified text is the exception. With text-align: justify, the browser stretches or shrinks the word gaps on each line so both edges align. Word gaps vary line to line. Long words and narrow columns produce rivers of white space. Your options are:
- Make the column wider, so each line has more gaps to share the adjustment.
- Turn on hyphenation with
hyphens: autoand alangattribute on the page, so long words can break. - Fall back to
text-align: leftfor narrow columns.
Do not try to fix justification by adding letter-spacing to a whole paragraph. Print layout tools such as InDesign allow small adjustments to letter spacing during justification, set as minimum, desired, and maximum percentages. Changes of a few percent are usually acceptable. On the web, letter-spacing is a fixed value, so you cannot change it per line.
Edge cases and pitfalls
- Trailing space after the last character. Browsers add
letter-spacingafter every character, including the final one on a line. In centered text or in a button label, this leaves the text slightly off center by the tracking amount. A common fix is a negativemargin-rightequal to the letter-spacing, or a matchingpadding-lefton the opposite side. - No-break spaces. A non-breaking space (
in HTML, U+00A0) is treated as a word separator, soword-spacingaffects it. Some fixed-width spaces, such as the thin space (U+2009), are also separators in many engines, but behavior varies. Test the characters you rely on. - Tab characters and collapsed whitespace. HTML collapses runs of spaces into one. You cannot widen a gap by typing extra spaces. Use
word-spacingor margins instead. - Scripts without word spaces. Chinese and Japanese text normally has no spaces between words, so
word-spacingdoes nothing there. In those scriptsletter-spacingis not typically used for normal reading text either. - Cursive scripts. In Arabic and similar scripts, letters connect. Adding
letter-spacingbreaks the connections, so leave it at zero.word-spacingis still fine. - Ligatures. Browsers disable optional ligatures when
letter-spacingis non-zero. The rule is covered in the previous chapter. It matters here only because tracked, word-spaced labels may needfont-variant-ligatures: noneto keep rendering consistent across browsers.
Practical workflow
- Set tracking first, because it changes everything on the line.
- Look at the word gaps. Squint or blur the text and check whether words still read as separate blocks.
- Adjust
word-spacingin small steps, such as 0.02 em. Compare the result to the version without the adjustment. - Check several lines of real text. A single sample line can mislead you, since the sidebearings of the neighboring letters change each gap.
- Record the final values for each style (headline, label, body) in your design system, so they are not set ad hoc.
Exercise
A label is set in uppercase with letter-spacing: 0.15em. The font's space glyph is 0.25 em wide. Without any word-spacing, what is the added width at each word gap, what is the total gap (excluding sidebearings), and what CSS change would you try if the words look run together?
Show answer
Tracking is added after the space too, so the total gap is 0.25 em + 0.15 em = 0.40 em (the tracking contributes 0.15 em of extra width). Letter gaps grew by the same 0.15 em, so the word-to-letter ratio dropped. Try a small positive word-spacing, such as 0.1em, which gives a gap of 0.50 em, and compare by eye.
Exercise
A 4rem headline uses letter-spacing: -0.02em and still has loose-looking word gaps. Which property should you adjust, in which direction, and why does tightening letter-spacing alone not close the gap fully?
Show answer
Adjust word-spacing in the negative direction, for example -0.05em. The negative tracking narrows each space by only 0.02 em, which is small compared with the 0.25 em space glyph at display size, so a separate negative word-spacing is needed to close the word gaps more than the letter gaps.