Unitless
--
Free · Instant · No signup
Unitless line-height plus the matching px and percent values from font size and a 1.2-1.8 ratio.
Page updated 2026-09-04.
Unitless
--
Pixels
--
Percent
--
A 16px font size with a 1.5 leading ratio produces a line-height of 1.5 unitless, 24px in pixels (16 x 1.5), or 150% as a percentage -- three different CSS-valid ways to express the exact same visual line spacing.
All three values represent identical visual spacing at this specific 16px font size, but they behave very differently once nested elements with different font sizes enter the picture -- which is exactly the distinction the next section covers.
24px of line-height on 16px text means there's 8px of extra vertical space distributed around each line of text (24 - 16 = 8) -- roughly 4px above and below the text's own height, which is what creates comfortable breathing room between lines rather than cramped, touching text.
Unitless is the usual CSS choice so nested text inherits proportionally. A unitless line-height value (1.5, with no px or % attached) is inherited by nested child elements as that same ratio, recalculated against each child's own font-size -- a nested element with a smaller font-size correctly gets proportionally less line-height, rather than inheriting a fixed pixel value that might create cramped or excessive spacing relative to its own smaller text.
By contrast, a pixel-based line-height (24px) is inherited as that literal fixed pixel value -- a nested element with a much smaller font-size would inherit that same 24px, which might create excessive, disproportionate spacing relative to its own smaller text size, since the fixed value doesn't rescale with the child's font-size the way the unitless ratio does.
This inheritance difference is a well-known, easily-missed CSS gotcha -- setting line-height in pixels on a parent element and then wondering why deeply nested small text has oddly large line spacing is a common debugging scenario that traces directly back to this inheritance behavior.
For the font-size values this line-height ratio would actually apply to across a full type scale, the Typography Scale Calculator is the related tool.
For converting a specific font size into rem/em units alongside a fluid sizing suggestion, the Responsive Font Size Calculator covers that related conversion.
Pixel line-height = font size x ratio = 16 x 1.5 = 24px. All three output formats (unitless 1.5, pixel 24px, percentage 150%) represent this same 8px of extra vertical space split around each line at this specific 16px font size.
Unitless is the usual CSS choice so nested text inherits proportionally. A unitless value is inherited by nested elements as a ratio, recalculated against each element's own font-size -- so smaller nested text automatically gets proportionally smaller line-height. A fixed pixel value is inherited literally, which can create disproportionate spacing on nested text with a different, smaller font-size.
Unitless is the usual CSS choice so nested text inherits proportionally. Setting a fixed pixel line-height on a parent element and then finding that deeply nested small text has oddly large, disproportionate line spacing -- a well-known CSS gotcha that traces directly back to how fixed pixel values inherit literally rather than scaling with each element's own font-size.
At the moment they're set, yes -- 150% and 1.5 produce identical spacing on the same font-size. But percentage-based line-height, like the pixel value, computes to a fixed value at the point it's set and doesn't recompute proportionally the way unitless values do when inherited by nested elements with different font sizes.
Not universally -- 1.5 is a commonly recommended comfortable ratio for body text, but very tight text (close to 1) can feel cramped, while very loose text (well above 2) can make it harder to track from the end of one line to the start of the next. The right ratio depends on font, line length, and context.
Text Banner ASCII Art Generator Map A-Z, 0-9, and spaces into a three-row block banner. Does not convert a photo to ASCII.
Color Picker from Image Sample colors from a canvas image.
Color Contrast Ratio Checker (WCAG 2.1 AA / AAA Compliance) Relative luminance contrast between two colors with WCAG 2.1 AA and AAA pass or fail for normal and large text.
Hex Sample Mixer Deduplicate pasted hex samples and average them into a mix hex. Does not cluster image pixels.