Line Height Calculator

Enter a font size and ratio to get the exact CSS line-height value in px, rem, and unitless formats.

Typography Settings

1.0 Headings: 1.1–1.3 Body: 1.4–1.6 3.0

CSS Values

Unitless
1.5
Pixels
24px
rem
1.5rem
CSS Snippet
font-size: 16px;
line-height: 1.5;

Live Preview

The quick brown fox jumps over the lazy dog. Typography is the art and technique of arranging type to make written language legible, readable, and appealing when displayed. Good line height is essential for comfortable reading across devices and screen sizes.

Preview reflects current font size and line height.

Common Presets

Copied!

Summary

Enter a font size and ratio to get the exact CSS line-height value in px, rem, and unitless formats.

How it works

  1. Enter the font size in pixels (e.g. 16).
  2. Choose or type a line-height ratio (1.0–3.0). Common best-practice ranges: 1.4–1.6 for body copy, 1.1–1.3 for headings.
  3. The calculator multiplies font size × ratio to produce the pixel value.
  4. Pixel value is divided by the root font size (default 16px) to get the rem value.
  5. The unitless value is displayed as the ratio itself — the recommended CSS approach.
  6. Copy the value you need in any unit from the result panel.

Use cases

  • Determine the right line-height for body text to meet WCAG readability guidelines.
  • Convert a designer's pixel spec to rem or unitless for a CSS design system.
  • Compare how multiple font sizes look at the same ratio in the live preview.
  • Pick a heading line-height that tightens spacing without clashing descenders.
  • Validate that a line-height in your stylesheet matches the intended ratio.
  • Calculate values for responsive typography scales quickly without manual math.

Frequently Asked Questions

Last updated: 2026-06-09 · Reviewed by Nham Vu