16px to REM

16px = 1rem at the default 16px root font size. Change the root size below if your project uses a different base.

By Mohamed Farhan · Updated Oct 19, 2026

Root font size

16px = 1rem at a 16px root font size

16px at other root font sizes

10px root1.6rem
12px root1.3333rem
14px root1.1429rem
16px root1rem
18px root0.8889rem
20px root0.8rem

The formula

rem stands for "root em": a size relative to the font size of the html element. To convert, divide pixels by the root font size.

Formula
rem = px / root font size
16 / 16 = 1rem
CSS
.title {
  font-size: 1rem; /* 16px */
}

Nearby conversions

PixelsREM (16px root)Tailwind
1px0.0625rem–
2px0.125remp-0.5
4px0.25remp-1
6px0.375remp-1.5
8px0.5remp-2
10px0.625remp-2.5
12px0.75remtext-xs
13px0.8125rem–
14px0.875remtext-sm
15px0.9375rem–
16px1remtext-base
18px1.125remtext-lg
20px1.25remtext-xl
22px1.375remp-5.5
24px1.5remtext-2xl
26px1.625remp-6.5
28px1.75remp-7
30px1.875remtext-3xl
32px2remp-8

Where 16px is used

16px is the browser default font size and the most common size for body text on the web. It is the reference point for rem: 1rem equals 16px unless the root font size is changed. Most accessibility guidance treats 16px as the minimum comfortable size for long reading. As spacing, 16px is one of the most-used values for padding inside cards and gaps between elements.

16px in type and spacing scales

  • On an 8px grid, 16px is exactly 2 units.
  • On a 4px grid, 16px is 4 units.
  • In Tailwind, 16px is the default size of text-base, and the spacing scale covers it as step 4 (p-4, gap-4).
  • As em, 16px is 1.143em inside 14px text, 1em inside 16px text and 0.889em inside 18px text.
  • As a percentage of the default 16px font size, 16px is 100%.

Line height and spacing for 16px text

If you use 16px (1rem) for body or interface text, a line-height of about 1.5 works well, which gives 24px between baselines. Longer paragraphs benefit from slightly more (1.6 to 1.7), while buttons and labels can go tighter (1.2 to 1.3).

For spacing below a block of 16px text, a margin of 0.75em to 1em (12px to 16px) keeps the rhythm consistent with the text size. Writing these values in em ties them to the font size, so they adjust automatically if the text size changes.

A fluid 16px with clamp()

Instead of a fixed 1rem, you can let the size scale smoothly between a smaller value on phones and 16px on desktops. The CSS clamp() function takes a minimum, a preferred value and a maximum. The example below grows from 13px on a 375px-wide screen to 16px on a 1280px-wide screen, and never goes outside that range. Because the minimum and maximum are in rem, the size still respects the user's font settings.

CSS
.title {
  font-size: clamp(0.8125rem, 0.735rem + 0.331vw, 1rem);
}

Why rem instead of px

A rem is relative to the root font size, so 1rem stays equal to 16px only while the root is 16px. When someone raises the default font size in their browser, say to 20px, the same 1rem becomes 20px, and your layout scales with it. A hard-coded 16px stays at 16px and ignores that preference.

That matters for accessibility. Many people with low vision rely on larger default text, and the WCAG resize text guideline expects content to remain usable when text is scaled up to 200 percent. Using rem for type and spacing is the simplest way to support that without extra work.

Common conversion mistakes

  • Assuming the root is always 16px. If your CSS sets html { font-size: 62.5% }, 16px is 1.6rem, not 1rem. Check the root before converting.
  • Converting borders. Keep 1px borders and hairlines in px; converting them to tiny rem values can make them render inconsistently.
  • Rounding too aggressively. Values like 0.8125rem look odd but are exact. If you round them, round to your spacing grid rather than to one decimal place.
  • Mixing units for the same role. If font sizes are in rem but margins are in px, spacing will not scale with text.

A worked example with 16px

Here is how 16px might appear in real CSS. The card title uses 1rem, spacing uses rem values from the same 16px base, and the border stays in px so it remains a crisp hairline. If a visitor's default font size is 20px, the title grows to 20px and the spacing grows with it, while the border stays 1px.

CSS
.card-title {
  font-size: 1rem;      /* 16px */
  line-height: 1.5;
  margin-bottom: 0.5rem;   /* 8px */
}
.card {
  padding: 1.5rem;         /* 24px */
  border: 1px solid #e7e5e4; /* stays px */
}

Converting in Sass, CSS variables and JavaScript

If you convert values often, let your tools do it. In Sass, a small function such as rem($px) that returns math.div($px, 16px) * 1rem turns rem(16px) into 1rem at compile time. In plain CSS, you can keep the pixel value readable with calc(16 / 16 * 1rem), which modern browsers resolve to 1rem.

In JavaScript, for example when generating inline styles or design tokens, divide by the root font size: 16 / 16 = 1. If you need the live root size (for users who changed their default), read parseFloat(getComputedStyle(document.documentElement).fontSize) instead of assuming 16.

Naming 16px as a design token

Design systems rarely use raw numbers in components. Instead, 16px would live in a token such as --font-size-base for type or --space-4 for spacing, defined once as 1rem. Components then reference the token, so a later change to the scale updates every use at once.

If your team uses Figma variables or a tokens file (for example in the W3C design tokens format), store the value in px for designers and generate the rem version in the build step. That keeps both sides speaking the same language while the shipped CSS stays accessible.

How browsers resolve rem

When the browser computes a rem value, it multiplies it by the computed font size of the html element. That font size starts from the user's default (16px unless they changed it), then applies whatever your CSS sets on html. So 1rem means "1 times the root size", and it is resolved once per page, unlike em, which is recalculated at every level of nesting.

Because the root is shared, rem values are predictable across the whole document: a 1rem gap in a sidebar is exactly the same size as a 1rem gap in a modal, regardless of the text size inside each.

Sass, CSS and JavaScript
// Sass
@use "sass:math";
@function rem($px, $base: 16px) {
  @return math.div($px, $base) * 1rem;
}
.card { padding: rem(16px); } // 1rem

/* CSS */
.card { padding: calc(16 / 16 * 1rem); }

// JavaScript
const root = parseFloat(getComputedStyle(document.documentElement).fontSize);
const rem = 16 / root; // 1 at a 16px root

Sources and further reading

Skip the unit math

Inspo AI generates responsive React + Tailwind screens with a consistent rem-based type and spacing scale built in.

Generate a screen

More conversions

Questions people ask

How many rem is 16px?

16px is 1rem when the root font size is 16px, which is the default in every major browser.

How do I convert 16px to rem?

Divide the pixel value by the root font size: 16 / 16 = 1rem. If your root font size is different, divide by that number instead.

What is 16px in Tailwind?

16px is the default size of Tailwind's text-base class. For spacing, 16px is the 4 step (for example p-4 or gap-4).

Why use rem instead of 16px?

rem scales with the user's browser font size setting, so layouts stay accessible for people who need larger text. px stays fixed regardless of that setting.

Is 16px a good font size?

16px is a comfortable size for interface and body text. See the line-height guidance above for pairing it with spacing.

What is 16px in em?

Inside text with a 16px font size, 16px is 1em. em is relative to the element's own font size, so the value changes if the parent text size changes.

Mohamed Farhan
Mohamed Farhan•Author & CEO•LinkedIn

↘ Building Inspo AI | AI-Powered Design Research & Builder Platform | Design Engineer.