Baseline typography starts with one simple idea: every line of Latin text sits on an invisible rule called the baseline. It is the zero point of a font. Cap height, x-height and ascenders are all measured upwards from it, and descenders are measured downwards. Our typography anatomy guide gives the short definition; this page is the practical version, covering how to find the baseline, the grids built on it, and how to align to it in CSS.
How to spot the baseline
- Look at flat-bottomed letters. The bottoms of x, z, H, E, n and m sit exactly on the baseline. Draw a line under them and you have found it.
- Notice the overshoot. Round letters such as o, c, e and s dip a little below the line, and pointed letters such as v and w often do too. This is deliberate: a circle that only touched the line would look smaller than its flat neighbours. In the Google Fonts files we measured on 25 November 2026, the lowercase o of EB Garamond dips 14 units below the baseline on a 1,000-unit em, and the o of Inter dips 24 units on a 2,048-unit em.
- Ignore descenders. The tails of g, j, p, q and y drop below the baseline on purpose. They are measured from it, not part of it. See ascender and descender for those parts.
- Watch the figures. Lining figures sit on the baseline like capitals. Oldstyle figures do not all behave the same: some, like 3, 4, 5, 7 and 9, drop below it.
The baseline inside a font file
In a digital font every glyph is drawn on a coordinate grid, and the baseline is the line where the vertical coordinate is zero. Font metrics such as the typographic ascender and descender, and the cap height and x-height values stored in the font’s OS/2 table, are all distances from that zero line. The OpenType specification describes the cap height, for example, as “the distance between the baseline and the approximate height of uppercase letters”. Because every measurement shares that origin, the baseline is what lets two different fonts sit together on one line.
Why the baseline matters in print
Baseline grids. In magazines, books and reports, designers often snap every line of body text to a baseline grid: a set of evenly spaced horizontal lines equal to the leading. When two columns sit side by side, their lines match across the gutter, and text on the front of a thin page lines up with text on the back, which reduces show-through. InDesign, Affinity Publisher and similar layout apps all offer a baseline grid setting.
Mixed sizes. Headings, captions and pull quotes rarely share the body leading. A common approach is to give them a line height that is a multiple or simple fraction of the grid, so body text returns to the grid after each interruption. Our kerning, tracking and leading guide covers how leading itself is measured, baseline to baseline.
Why the baseline matters on the web
Inline alignment. In CSS, the initial value of vertical-align is baseline, which MDN describes as aligning “the baseline of the element with the baseline of its parent”. That is why an inline image sits on the text line with a small gap below it: the gap is the room left for descenders. Setting the image to display: block or vertical-align: middle removes it.
Flexbox and grid. align-items: baseline lines up items by the baseline of their first line of text rather than by their boxes. It is the right choice for a row containing a large price next to a small label, or tabs with different font sizes, because the text sits on one line even though the boxes differ in height.
Trimming to the baseline. The newer text-box-trim and text-box-edge properties let you cut the extra space above and below a line box. A value such as text-box: trim-both cap alphabetic trims the top to the capital letters and the bottom flush with the alphabetic baseline, which makes spacing between text and other elements match what designers draw in their mock-ups. MDN lists it as newly available across current browsers, so older browsers will simply ignore it.
Mixing fonts. Two fonts at the same size can have very different metrics. If a heading font and a body font look misaligned in a button or a badge, the baselines are usually fine; it is the difference in cap height and line box height that makes one look higher. Our cap height page explains how to compensate.
Common baseline mistakes
- Centring text by its box. Vertically centring a label in a button by its line box often puts the text slightly high or low, because the box includes space for accents and descenders. Judge by eye, or trim the box to the cap height and baseline.
- Aligning icons to the box, not the text. An icon beside a label should usually sit on the baseline or be centred on the x-height or cap height, not on the full line box.
- A grid too coarse or too fine. A baseline grid larger than the body leading wastes space; one that is too fine stops being useful. Set it equal to the body leading.
- Forcing every element onto the grid. Large display headings snapped to a small grid can end up with awkward gaps. Let them breathe, then bring the body text back to the grid.
- Removing overshoot in lettering. When drawing a logo, letting round letters only touch the baseline makes them look too small. Keep a small overshoot.
Related terms
- Cap height: the height of flat capitals above the baseline.
- X-height: the height of lowercase letters such as x above the baseline.
- Descender line: how far tails such as p and y drop below the baseline.
- Leading: the distance from one baseline to the next.
- Overshoot: the small amount round and pointed letters go past the baseline and other guide lines.
For the full A to Z, see our typography terms glossary.
Frequently Asked Questions
What is the baseline in typography?
It is the invisible line that letters sit on. Flat-bottomed letters rest on it, round letters dip just below it and descenders hang beneath it.
What is a baseline grid?
A baseline grid is a set of evenly spaced horizontal lines, usually equal to the body leading. Locking text to it keeps lines aligned across columns and pages.
Why does an image have a gap below it in HTML?
Images are inline by default and sit on the text baseline, leaving room underneath for descenders. Use display block or vertical-align middle to remove the gap.
Do all scripts use a baseline?
No. Latin, Greek and Cyrillic sit on an alphabetic baseline, but Devanagari hangs from a top line and Chinese and Japanese are set in an ideographic em box. Fonts store separate baselines for these.
What is the difference between baseline and x-height?
The baseline is the line letters sit on. The x-height is the distance from the baseline up to the top of lowercase letters such as x.


