html69// developer tools

CSS tool

px to rem Converter / rem to px Converter

Do you want CSS Clamp Generator?

A px to rem converter that is also a rem to px converter and a px to rem calculator. Root defaults to 16px. Convert em the same way. Specific values like 80 px to rem or 1.5 rem to px stay in this tab. It all stays on your computer.

Like the tool? Find a bug?Get in touch :)

Calculator

A px to rem converter and rem to px converter, plus em. Root defaults to 16px. Type 80px or 1.5rem, or paste 80 px to rem. Numbers stay on your device.

16px = 1rem at a 16px root. 1em if the parent is 16px.

12px to 64px chart

pxrememLoad
12px0.75rem0.75em
14px0.875rem0.875em
16px1rem1em
18px1.125rem1.125em
20px1.25rem1.25em
24px1.5rem1.5em
28px1.75rem1.75em
32px2rem2em
36px2.25rem2.25em
40px2.5rem2.5em
48px3rem3em
56px3.5rem3.5em
64px4rem4em
font-size: 1rem; /* 16px */
text-[1rem]
const root = 16;

export function pxToRem(px: number) {
  return `${px / root}rem`;
}

export function remToPx(rem: number) {
  return rem * root;
}

Runs on your computer. We never see what you paste or upload.

Guide

How this px to rem converter works

01

rem follows the root

1rem is the font size on html. Browsers start at 16px, so 16px is 1rem and 80px is 5rem. Change the root if your design uses 10px or 18px.

02

em follows the parent

1em is the font size of the current element's parent. When the parent matches the root, rem and em are the same number. Uncheck "em uses the root" to set a different parent size.

03

One calculator, not a page per size

Type 80 px to rem, 1 rem to px, or 1.5 rem to px here instead of opening a separate URL for each number. The chart covers 12px to 64px. Paste a CSS length or a Tailwind arbitrary value to load it.

FAQ

Questions

What is 80 px to rem?

At the default 16px root, 80 px to rem is 5rem (80 / 16). Load the 80px sample to copy CSS or Tailwind. If the root is 10px, 80px is 8rem.

What is 1 rem to px? What about 1.5 rem to px?

1 rem to px is 16px at a 16px root. 1.5 rem to px is 24px. Convert rem to px by typing the rem value; the px field updates with it.

Why rem instead of px?

Rem scales with the user's root font size, so browser zoom and accessibility defaults still apply. Use px when a design file is locked to device pixels.

Does this upload my CSS?

No. The px to rem conversion, the chart, and copy run in this tab. We never see it. It stays on your computer.

Share