Line Height

What Is the Line Height Calculator?

Calculate optimal line-height values for any font size. Preview text readability with adjustable font, size, and line-height combinations.

Why Use This Tool?

Line height (leading) is one of the most impactful typography settings for readability. Too tight and lines blur together; too loose and the eye loses track between lines. This tool helps you find the sweet spot.

How to Use This Line Height Calculator

  1. Enter your font size — Type the font size you're working with in pixels. Common values: 14–16px for body text, 24–48px for headings.
  2. Choose a ratio — Select a line-height multiplier. The tool suggests optimal ratios based on your font size and content type (body text, headings, captions).
  3. Preview the result — See your text rendered live with the calculated line-height applied. Compare different ratios side by side.
  4. Copy the CSS — Grab the line-height value as a unitless ratio (recommended) or in pixels, rem, or em — ready for your stylesheet.

Worked example: why unitless line-height inherits correctly

The calculator gives the same spacing as a unitless number, px, rem and em. They look interchangeable for one element, but they behave differently once the value is inherited, which is where most line-height bugs come from. This markup was rendered in Chromium on October 12, 2026 with four spellings of the same 24 px line-height on the parent, in a 300 px column where the heading wraps to three lines:

<div style="font-size: 16px; line-height: VALUE">
  <p>Body text</p>
  <h1 style="font-size: 48px">A heading long enough to wrap</h1>
</div>
Parent valueHeading line-heightHeading heightWhy
24px24 px72 pxlines overlap: each line gets half the font size
1.5em24 px72 pxsame as 24px: em is resolved on the parent, then inherited as a fixed length
150%24 px72 pxsame again: percentages are resolved on the parent too
1.5 (unitless)72 px216 pxthe factor is inherited and applied to 48 px

Only the unitless value carries over as a ratio; every length unit, including em and percent, is turned into pixels on the element where you set it, and the child inherits those pixels. That is why the unitless output is the one to put on body or any container; use the px, rem or em outputs only on the exact element you measured them for.

Leave room for readers who change the spacing. WCAG 2.2 success criterion 1.4.12 (Text Spacing) asks that no content or function is lost when a user sets line height to at least 1.5 times the font size, so avoid fixed heights and overflow: hidden on text boxes; a container sized for your own line-height will clip the text when theirs is larger.

Related tools

Frequently Asked Questions

What's the ideal line-height?
For body text, 1.4 to 1.6 is generally optimal. Headings work well at 1.1 to 1.3. The ideal value depends on font size, line length, and the specific typeface.
Should I use unitless or px line-height?
Always use unitless values (line-height: 1.5) rather than fixed units (line-height: 24px). Unitless values scale proportionally when font-size changes, while fixed values don't.
How does line-height interact with line length?
Longer lines need more line-height to help the eye track back to the start of the next line. Short lines (like mobile viewports) can use tighter leading.
What is a good line-height for body text?+
For body text at 14–18px, a line-height of 1.5 to 1.7 is generally optimal. WCAG 2.1 asks for at least 1.5 within paragraphs only at Level AAA (Criterion 1.4.8); the Level AA rule (1.4.12) is that your layout must survive a user setting line height to 1.5×.
Should I use px, em, or unitless line-height?+
Unitless values are recommended (e.g., line-height: 1.6). Unlike px or em, unitless values scale proportionally when the font size changes — avoiding inheritance problems where child elements get an unexpected fixed line-height.
How does line-height affect accessibility?+
Adequate line-height improves readability for people with dyslexia, low vision, and cognitive disabilities. WCAG 2.1 Success Criterion 1.4.12 (Level AA) does not set a minimum for authors; it requires that nothing breaks when a user overrides line height to 1.5× the font size and paragraph spacing to 2×. Criterion 1.4.8 (Level AAA) is the one that asks for line spacing of at least 1.5 within paragraphs.
What is the right line-height for body text?+
For typical web body text (15-18px), a line-height of 1.5 to 1.7 reads comfortably. Smaller text needs proportionally more line height (1.6-1.8 for 12-14px); larger headlines need less (1.1-1.3 for 32px and above). The calculator suggests a starting point based on your font size and lets you adjust from there with a visible-rendering preview. Designers often set body line-height in unitless ratios because they cascade correctly to child elements.
Should line-height be different for different fonts?+
Yes. Fonts with tall x-heights (Inter, Source Sans, most modern UI fonts) need slightly more line-height than fonts with shorter x-heights (Garamond, Caslon) at the same font-size, because the visible characters fill more of the line. The calculator does not read font metrics: its suggestions are by font size and content type, so for a tall-x-height face, start at the top of the suggested range and check the preview.

📖 Learn More

Related Article How to Calculate Optimal Line Height for Typography →

Built by Derek Giordano · Part of Ultimate Design Tools

Privacy Policy · Terms of Service