Sub topic 7
Units: from 1/1000 em tracking values to CSS em
This chapter explains how a tracking number in a design tool maps to a letter-spacing value in CSS. It assumes you know basic typography vocabulary (font size, glyph, baseline) and have used either a design tool such as Figma, Illustrator, or InDesign, or basic CSS. It also assumes you know what tracking is: a uniform change in space across a run of text.
Why units matter
Tracking is relative by nature. A spacing change that looks right on 12 px labels looks far too loose on a 96 px headline if you use a fixed distance. Typographers therefore express tracking as a fraction of the type size. That fraction is the em.
Design tools and CSS use different notations for the same idea. If you copy a number across without converting it, the result is wrong by a factor of 10, 100, or 1000. Knowing the conversion lets you move a design from a mockup to a stylesheet accurately.
The em as a unit
An em is a unit of length equal to the current font size. At 16 px, 1 em is 16 px. At 64 px, 1 em is 64 px. Despite the name, it is not tied to the width of the letter "M".
Because an em scales with the font size, a spacing value in em keeps the same proportion to the text at every size. A value of 0.05em is 0.8 px at 16 px and 3.2 px at 64 px. In both cases it is 5% of the type size.
Fonts have their own internal grid, called units per em. Common values are 1000 for PostScript-flavored fonts and 2048 for many TrueType fonts. Kerning values stored in the font use that grid, so a kern of -40 in a 2048-unit font is a smaller adjustment than -40 in a 1000-unit font. Tracking values in design tools do not use the font's grid. They always use thousandths of an em, whatever the font.
Thousandths of an em
Adobe applications (InDesign, Illustrator, Photoshop) measure tracking and kerning in units of 1/1000 em. Each unit is 0.001 em.
- A tracking of 0 adds nothing.
- A tracking of 100 adds 100/1000 em, which is 0.1 em, to the space after every character.
- A tracking of -50 removes 0.05 em after every character.
Positive values loosen the text and negative values tighten it. The same sign convention applies in CSS.
Many other tools show the same quantity differently:
| Tool or format | How the value is shown | Equal to 0.05 em |
|---|---|---|
| InDesign, Illustrator | Thousandths of an em | 50 |
| Figma | Percent of font size | 5% |
| CSS | Length, commonly em | `0.05em` |
| Fixed pixels | Absolute length | 0.05 × font size in px |
Figma's percent value divides by 100, because 5% is 0.05. The Adobe value divides by 1000. So 10 Adobe units equal 1% in Figma, and 50 units equal 5%.
The conversion formulas
The conversions are simple division and multiplication.
- CSS em = tracking units ÷ 1000
- Tracking units = CSS em × 1000
- Percent (Figma) = tracking units ÷ 10
- Pixels = CSS em × font size in px
function trackingToEm(units) {
return units / 1000;
}
function emToTracking(em) {
return em * 1000;
}
function emToPx(em, fontSizePx) {
return em * fontSizePx;
}
console.log(trackingToEm(75) + 'em'); // "0.075em"
console.log(trackingToEm(-20) + 'em'); // "-0.02em"
console.log(emToTracking(0.12)); // 120
console.log(emToPx(0.12, 12) + 'px'); // "1.44px"Here is a quick check of the idea. A designer sets a 12 px all-caps label with tracking of +120 in InDesign. Dividing by 1000 gives 0.12em. At 12 px that is 1.44 px added after each letter.
Reference values
This table shows common values at two sizes.
| Tracking units | CSS value | Figma percent | At 16 px | At 64 px |
|---|---|---|---|---|
| -20 | `-0.02em` | -2% | -0.32 px | -1.28 px |
| 25 | `0.025em` | 2.5% | 0.4 px | 1.6 px |
| 75 | `0.075em` | 7.5% | 1.2 px | 4.8 px |
| 100 | `0.1em` | 10% | 1.6 px | 6.4 px |
The same unit value gives a larger pixel change on a larger size. That is the intended behavior, because the visual effect stays proportional.
Writing the value in CSS
The CSS property is letter-spacing. It takes a length. A positive value adds space after each character and a negative value removes it. The keyword normal means no extra space beyond the font's own metrics and kerning.
.headline {
font-size: 4rem;
letter-spacing: -0.02em; /* design tool: -20 */
}
.eyebrow {
font-size: 0.75rem;
text-transform: uppercase;
letter-spacing: 0.12em; /* design tool: +120 */
}In both rules, the em value is relative to the element's own font-size. The same 0.12em on a 12 px label and a 24 px label gives different pixel distances, matching the design intent.
Choosing em over px or rem
You can write letter-spacing: 1.44px, but that value stays fixed if the font size changes later. If a media query raises the headline size, the spacing no longer matches the design. An em value follows the size automatically.
rem is relative to the root font size, not the element's size. It is a poor fit for tracking because the text size and the spacing drift apart. Use rem only if you want the spacing to depend on the page's base size on purpose.
Percentages in letter-spacing are part of newer CSS drafts. Browser support has not been consistent, so use em for work that must render everywhere.
Gotcha: em is resolved once, then inherited as pixels
The computed value of letter-spacing is an absolute length. The browser resolves the em where you declare it and passes the resulting pixel value to child elements. It does not pass the em itself.
.card {
font-size: 1rem;
letter-spacing: 0.1em; /* computes to 1.6px at 16px */
}
.card .title {
font-size: 2rem; /* inherits 1.6px, not 0.1em */
}The title is 32 px, but it inherits 1.6 px, which is only 0.05 em at that size. If you want the title to track at 0.1 em, set letter-spacing: 0.1em on .title itself. In general, put letter-spacing on the element whose font size you want it tied to. Avoid setting it on a wide container such as body unless every descendant should receive the same fixed pixel amount.
Gotcha: trailing space after the last letter
Browsers add the letter-spacing after every character, including the last one on a line. In centered text, this makes the line sit slightly off center, because an invisible gap trails the final glyph. The error is small at 0.02 em and visible at 0.2 em. Compensate by adding matching space on the other side:
.centered-label {
text-align: center;
text-transform: uppercase;
letter-spacing: 0.2em;
padding-left: 0.2em; /* balances the trailing space */
}The padding is also in em, so it scales with the size, in the same way as the tracking.
Rounding and sub-pixel behavior
Design tools often show values such as 7.5% or 75 units. In CSS, keep up to three or four decimal places, such as 0.075em. Rounding to 0.08em changes the spacing by 0.005 em, which is 0.08 px at 16 px and usually invisible. At display sizes such as 120 px it is 0.6 px per letter, which adds up across a word.
Browsers may also snap glyph positions to the pixel grid, depending on the rendering engine and settings. Very small fractional values can therefore look uneven on low-resolution screens even though the arithmetic is correct. Check the result at the real size and on the target displays before committing to fine adjustments.
Common mistakes
- Dividing by 100 instead of 1000. A tracking of 75 becomes
0.75em, which scatters the letters. Adobe units divide by 1000. - Mixing up percent and units. Figma's 5% is 50 Adobe units. Typing
0.5emfor it is ten times too large. - Using px for fluid type. A fixed pixel value breaks the proportion when the font size changes with the viewport.
- Ignoring the sign. A designer's -20 means tighter. Dropping the minus sign loosens the text.
Exercise
A designer hands you an InDesign style for an all-caps label: 11 px type, tracking +80. Write the CSS rule for letter-spacing and say how many pixels of extra space are added after each letter.
Show answer
Divide 80 by 1000 to get 0.08 em, so the rule is letter-spacing: 0.08em;. At 11 px the extra space is 0.08 × 11 = 0.88 px after each letter.
Exercise
A Figma headline uses letter spacing of -2.5%. What is the equivalent Adobe tracking value and CSS letter-spacing? Then explain why you should not set that letter-spacing on a parent whose children have larger font sizes.
Show answer
-2.5% is -0.025 em, which is -25 in thousandths of an em. The CSS is letter-spacing: -0.025em;. The browser resolves the em to a pixel length on the element where it is declared, and children inherit that pixel length. A child with a larger font size would then be tracked tighter or looser in proportion than designed, so declare the value on each element whose size differs.