CSS Typography Unit Converter (px, rem, em, pt & Viewport Width)

Calculate responsive CSS rem scales and 96-DPI print point equivalents.

Responsive Size in CSS rem 1.25 rem
Print Points (pt at 96 DPI) 15 pt
Computed Line-Height (px) 30 px
Percentage of Root Font 125 %
Inputs
Try:
px
Target font size or spacing in CSS pixels (px).
px
Root HTML font-size in pixels (browser default is 16px).
×
Line-height multiplier for vertical rhythm.
Results & Graph
Responsive Size in CSS rem
1.25 rem
Print Points (pt at 96 DPI)
15 pt
Computed Line-Height (px)
30 px
Percentage of Root Font
125 %

Responsive Size in CSS rem

Graph 1 • How the inputs feed px to rem / pt
CSS Typography Unit Converter (px, rem, em, pt & Viewport Width) • Custom Domain Schematic (Design & Typography) Exact SI / Imperial Factor Bridge (px to rem / pt) Target Px: 20 px • Root Font Px: 16 px RESPONSIVE SIZE IN CSS REM 1.25 rem • Print Points (pt at 96: 15 pt • Computed Line-Height (: 30 px Eq: rem = px / baseFontPx; pt = px ×
Graph 2 • Responsive Size in CSS rem as Target Px changes (40% to 160% of current)
0 rem 1.10 rem 2.20 rem 0.500 8px 0.750 12px 1 16px 1.25 20px 1.50 24px 1.75 28px 2 32px
Graph 3 • Target Px and Root Font Px together Compares Responsive Size in CSS rem when Root Font Px is shifted +25% (solid) vs. −25% (dashed).
0 rem 1.19 rem 2.38 rem --- Root Font Px @ 75% 0.700 -30% 0.850 -15% 1 +0% 1.15 +15% 1.30 +30%
Summary: 20px at a 16px root font-size equals 1.25rem, 15pt in print, and 30px computed line-height.
Summary: 20px at a 16px root font-size equals 1.25rem, 15pt in print, and 30px computed line-height.
Interactive chart & math engine powered by CalculatorGraph

Formula: px to rem / pt Conversion & Formula

rem = px / baseFontPx
pt = px × (72 / 96)
lineHeightPx = px × lineHeightRatio
rem = px / baseFontPx; pt = px × (72 / 96); lineHeightPx = px × lineHeightRatio
  • targetPx: Target (px)
  • rootFontPx: Root Font (px)
  • lineHeightRatio: Line Height Ratio (×)

Rounding: Exact NIST/BIPM conversion factors are used internally; displayed values round to 2–4 decimal places.

Frequently Asked Questions

Does a 15pt result mean the text will measure 15pt on my monitor?

Not physically. CSS treats 1px as 0.75pt by definition, so the 15pt figure is exact in CSS terms and on paper when printed at 100 percent scale. On screen, the physical size depends on the device's pixel density and zoom, and a CSS pixel is a reference unit rather than one hardware dot. Use the point line for print specs, not for measuring a screen with a ruler.

Can I use the rem answer as an em value?

Only when the parent element's computed font size equals the root you entered. The tool divides by the Root Font field, while em divides by the parent's size. For text inside an 18px container, put 18 in the Root Font field and the main answer becomes the em value for that context. The point and line-height results are unaffected by that swap.

Why does the line-height follow the target size and not the root?

Because a unitless line-height such as 1.5 is applied to each element's own font size. The converter mirrors that: 20px at 1.5 gives 30px, 12px gives 18px. If your stylesheet sets line-height in rem instead, the line box would be fixed against the root and would not grow with the font, which this tool does not model.

How do I get picas from these results?

Divide the point figure by 12, since a pica is 12 points. The default 20px gives 15pt, so 1.25 picas. The 30px Higher preset gives 22.5pt, which is 1.875 picas. The page does not show a pica line, so this is a quick manual step after reading the Print Points value.

What root size should I enter if my CSS sets html to 62.5 percent?

Enter 10, assuming the browser default is 16px, because 62.5 percent of 16 is 10. Then 24px returns 2.4rem. Remember that readers who raise their browser's default text size will have a larger root than 10px, so the real rendered size scales up for them, which is the intended accessibility benefit of a percentage root.

Why did the main answer show 0.889 when the sentence says 0.8889?

The headline value is rounded to three decimals and the sentence beneath it to four. With a 16px target and an 18px root the exact value repeats forever, so both are rounded versions of the same number. Copy the four decimal figure into CSS if you want the closest match, though the visual difference at normal sizes is well below a pixel.

Is the pixel to point ratio different on Retina or high DPI screens?

No. The 0.75 ratio comes from the CSS definition that 96px equals one inch and 72pt equals one inch. High density screens draw each CSS pixel with several hardware pixels, but the CSS units keep the same relationship to each other. The converter's point output stays the same on every device, which is why it never asks for screen resolution.

What happens if I leave the Root Font field at zero?

The calculator stops and asks for a root font size above 0 px, noting that browsers default to 16. A root of zero would mean dividing by zero, so no rem value can exist. The same check rejects a negative target size and a line-height ratio of zero. Enter your actual root, usually 16, and the result returns.

Does this converter handle viewport width units?

The title mentions viewport width, but the three inputs are target pixels, root font and line-height ratio, and no vw figure is calculated. To find a vw value by hand, divide the pixel size by the viewport width and multiply by 100. Treat that as a separate step outside this tool.

Should body text be set in rem or px?

Rem is the usual choice because it follows the root, and a percentage root follows the reader's browser setting. That lets people who need larger text get it without zooming the whole layout. Pixels are fixed against that preference. The converter helps either way: it shows the rem equivalent of a pixel size from a design file so you can write the scalable version.

Why is 16 the default root font size here?

Major browsers ship with a default text size of 16px, and if your stylesheet does not set a font-size on the html element, that is the root every rem is measured against. The converter starts there so the first answer matches an unstyled page. If your project changes the root, or you are converting for an em context, replace it with the real computed size.

20px on a 16px root becomes 1.25rem, 15pt and a 30px line

Out of the box the converter takes a 20px size, assumes the browser's usual 16px root font, and applies a line-height ratio of 1.5. It returns 1.25rem as the main answer. Underneath sit 15pt for print, a computed line-height of 30px, and 125 % as the size expressed against the root.

Each of those comes from one short step. 20 divided by 16 is 1.25, so that is the rem value. 20 multiplied by 0.75 is 15, which is the point size. 20 multiplied by 1.5 is 30, the line box height. The percentage is simply the rem value times 100.

None of this needs a screen, a DPI setting or a font file. The converter is doing the same arithmetic a browser does when it resolves your stylesheet, so the numbers are exact rather than estimates. What you get is a translation between units, not a judgement about whether 20px is a sensible size for the job.

A typical use is a handoff. A design file says a subheading is 20px, and the codebase writes sizes in rem. Type 20, read 1.25rem, and paste it. If the same subheading also appears in a printed brochure, the 15pt line is the size to give the print designer, and the 30px line tells the developer how tall each line of that subheading will be.

Why rem divides by the root and not by the parent element

A rem is always measured against the font-size set on the html element. That is the only thing the Root Font field controls. If your stylesheet leaves the root alone, most browsers start at 16px, and that is why 16 is the default here.

The title of the tool mentions em as well, and it helps to be clear about what that means. An em is measured against the font size of the element's parent, not the root. So the rem figure on screen is also the em figure only when the parent's computed font size equals the root. Inside a card whose text is already 18px, 20px is about 1.11em, not 1.25em. The converter does not ask for a parent size, so for nested em work type the parent's computed size into the Root Font field instead. The division is the same; you are just changing what you divide by.

That swap is worth doing deliberately. Em values compound. A list nested three levels deep at 0.9em each ends up noticeably smaller than its outer text, which is the classic reason teams moved font sizes to rem and kept em for padding and margins that should grow with the local text.

The fixed 0.75 behind every point figure

CSS defines an inch as exactly 96px, and a point is 1/72 of an inch. Put those together and 1px is 0.75pt, always, on every device. That is the whole formula behind the Print Points line, and it is why the label says 96 DPI.

People often read that label as a claim about their monitor. It is not. A phone with a dense display and an old office screen both treat 1 CSS pixel as 0.75pt, because the CSS pixel is a reference unit, not a physical dot. When the page is printed, the browser honours the 96 to 72 ratio, so 20px really does come out as 15pt type on paper.

If you want picas, divide the point figure by 12. The default 15pt is 1.25 picas. The Lower preset's 12px gives 9pt, which is 0.75 of a pica, and the Higher preset's 30px gives 22.5pt, a little under 2 picas. The converter does not print the pica line itself, so do this step by hand.

Line-height ratio: unitless numbers turned into pixels

The third field is the multiplier you would write as line-height: 1.5 in CSS. The converter multiplies it by the target size, not the root, which matches how a unitless line-height behaves: each element works out its own line box from its own font size.

With the defaults that gives 30px. Drop the target to 12px, as the Lower preset does, and the line box falls to 18px. Raise it to 30px and it becomes 45px. A heading at 48px with a tighter ratio of 1.1 gives 52.8px, which is a useful check when you are trying to make a two line heading fit a fixed hero area.

Fractional results like 52.8px are normal. Browsers keep sub-pixel values internally and round only when they paint. If you are aligning text to a baseline grid, though, a ratio that lands on whole pixels is easier to reason about. At 16px, a ratio of 1.5 gives 24px and 1.25 gives 20px, both clean. At 14px, 1.5 gives 21px, also whole.

Spacing tokens can use the same field. If a design system ties vertical margins to the line box, the computed line-height is the unit to repeat. A 30px rhythm at the default settings means paragraph gaps of 30px or 15px keep everything on the same grid.

Changing the root: the 10px habit and user font settings

Some stylesheets set the root to 62.5 percent so that 1rem equals 10px and the maths becomes trivial. Enter 10 in Root Font and 24px returns 2.4rem, 18pt and a 36px line. The point figure did not move, because points depend only on pixels and never on the root.

That is the main trap with the habit. If a reader has told their browser to use a larger default text size, a percentage root scales with it, so 1rem is no longer 10px for them. Their text grows, which is what they asked for. A root set in fixed pixels would ignore their setting. The converter cannot see a reader's preferences; it assumes whatever root you type.

A larger root is equally easy to test. With an 18px root and a 1.6 ratio, 16px body text comes out at 0.889rem and a 25.6px line. The headline value is rounded to three decimal places while the sentence underneath shows 0.8889, so copy the longer figure if you need the extra precision in CSS.

Building a small type scale one size at a time

The tool converts one size per run, so a scale means a few runs. On a 16px root, 12px is 0.75rem, 14px is 0.875rem, 16px is 1rem, 20px is 1.25rem, 24px is 1.5rem, 30px is 1.875rem, 32px is 2rem and 48px is 3rem. Those come straight from the calculator and divide evenly, which is part of why designers like a 16px base.

The Higher preset of 30px is a good example of a value that does not land on a tidy rem. 1.875rem is exact, so it is fine to use, but it shows up as 187.5 % in the percentage line and 22.5pt in print. If a design file specifies sizes in points for a print piece, those halves are worth checking against what the print designer expects.

Write down the line-height alongside each size as you go. A scale that looks balanced in rem can still feel cramped if every step uses 1.5 regardless of size. Larger headings usually want smaller ratios, and the computed pixel line tells you quickly whether the gap between lines is getting too big.

Entry slips that produce believable wrong answers

The most common slip is typing a point size into the Target field. A designer reads 12 from a print spec and enters it as pixels; the tool replies 0.75rem, which is really 9pt type. Convert the point size to pixels first by dividing by 0.75, so 12pt becomes 16px.

Another is entering a rem value as the target. The field wants pixels. If you already have 1.5rem and want pixels, multiply by your root instead of running the converter.

The tool does guard against the impossible cases. A negative target size, a root font of zero or a line-height ratio of zero returns a message asking for a size of 0 px or more, a root above 0 px and a ratio above 0, instead of a number. What it cannot catch is a plausible slip, such as a root of 61 when you meant 16, so glance at the percentage line: if 20px reads as far more or far less than expected, the root is the first field to recheck.

Line-height has its own version of this slip. The field expects a ratio such as 1.5, not a pixel value. Typing 24 because the design shows a 24px line multiplies the 20px default by 24 and produces a line box far taller than the page, which is obviously wrong once you look at it but easy to miss if you only copy the rem answer. To turn a pixel line-height from a design into a ratio, divide it by the font size first: 24 divided by 16 is 1.5.

Reading the percentage line correctly

The Percentage of Root Font output is the rem value times 100. For the default, that is 125 % of the root. It is a handy way to sanity check proportions, and it matches what you would write as font-size: 125% on an element whose parent happens to be at the root size.

Be careful using it on nested elements. Percentage font sizes in CSS work like em, relative to the parent. So the percentage the tool reports is only the right CSS value when the parent's computed size equals the root you entered. For the 12px Lower preset the line reads 75 %, and that value would make text 12px only if its parent is 16px.

For most component work, the rem figure is the one to paste, and the percentage is there for reading the scale at a glance.