Pixel to REM Converter

Convert Pixels (px) to REM and REM to Pixels instantly. Customize your base font size and visualize typography inheritance in real-time.

📏 Dynamic Base Size⚡ Instant Updates🎨 Inheritance Playground

Calculation Workspace

16px
px

Standard browser root base is 16px. Drag or type to change.


px
rem
em

Quick Reference Conversion Tables

These tables calculate dynamically based on your root base font size of 16px. Click copy icons on any row to extract standard design system guidelines.

Pixel to REM Reference Map

Pixel (PX)REM (rem)EM (em)Percentage (%)Action
6px0.375rem0.375em37.5%
7px0.4375rem0.4375em43.75%
8px0.5rem0.5em50%
9px0.5625rem0.5625em56.25%
10px0.625rem0.625em62.5%
11px0.6875rem0.6875em68.75%
12px0.75rem0.75em75%
13px0.8125rem0.8125em81.25%
14px0.875rem0.875em87.5%
15px0.9375rem0.9375em93.75%
16px1rem1em100%
17px1.0625rem1.0625em106.25%
18px1.125rem1.125em112.5%
19px1.1875rem1.1875em118.75%
20px1.25rem1.25em125%
21px1.3125rem1.3125em131.25%
22px1.375rem1.375em137.5%
23px1.4375rem1.4375em143.75%
24px1.5rem1.5em150%
25px1.5625rem1.5625em156.25%
26px1.625rem1.625em162.5%
28px1.75rem1.75em175%
30px1.875rem1.875em187.5%
32px2rem2em200%
36px2.25rem2.25em225%
40px2.5rem2.5em250%
48px3rem3em300%
64px4rem4em400%
96px6rem6em600%
128px8rem8em800%

REM to Pixel Reference Map

REM (rem)Pixels (PX)Action
0.1rem1.6px
0.2rem3.2px
0.25rem4px
0.375rem6px
0.5rem8px
0.75rem12px
0.875rem14px
1rem16px
1.25rem20px
1.5rem24px
1.75rem28px
2rem32px
2.5rem40px
3rem48px
4rem64px
5rem80px
6rem96px
8rem128px
10rem160px
12rem192px
16rem256px
20rem320px
24rem384px
32rem512px
40rem640px
48rem768px
64rem1024px

Interactive CSS Inheritance Playground

Learn how REM and EM scale relative to different base elements. Modify settings below to watch font scaling visual elements react live!

16px

Affects the root <html> element and all REM units.

1.5rem

Sized in REM. Sizing computed: 24px

1.2em

Sized in EM. Sizing relative to parent. Computed: 28.8px

ROOT Element
html { font-size: 16px; }
Root Text (16px)
PARENT Element
.parent { font-size: 1.5rem; }

Computed value: 24px (16 × 1.5)

Parent Typography (24px)
CHILD Element (Nested)
.child { font-size: 1.2em; }

Computed value: 28.8px (24 × 1.2)

Nested Child (28.8px)

CSS Typography & Units Educational Guide

1 Pixel vs. Device Pixel vs. CSS Pixel

In web design, it's vital to distinguish between physical and logical units:

  • Physical / Device Pixel: The actual hardware light emitter dots on the physical screen. For high-density Retina or AMOLED screens, one logical unit consists of 4 or 9 physical device pixels.
  • Logical / CSS Pixel (px): An abstract reference unit defined by the W3C. 1 CSS pixel always represents 1/96th of an inch. Web design rules compile exclusively using CSS pixels, guaranteeing consistent layout layouts across resolutions.

2 What are REM and EM?

Both are relative CSS sizing units, but they derive their rendering anchors differently:

  • REM (Root Element em): Scales relative to the font-size of the <html> element. If the root size is 16px, 2rem is exactly 32px. Very predictable and safe for responsive grids.
  • EM (Element em): Scales relative to the font-size of its direct parent container. If a parent has a font-size of 20px, 1.5em inside that container equals 30px. Ideal for labels or paddings.

3 Best Practices: Pixel vs. REM vs. EM

Pixel (PX) — Absolute Sizing

Use for absolute dimensions that should never scale, such as border widths, thin box-shadows, image boundaries, and fixed-width dividers.

REM — Root-Relative Sizing

Use for body typography, paragraph text, headings, layout columns, outer spacing margins, and main paddings. This guarantees the entire site responds gracefully to user browser preferences.

EM — Local-Relative Sizing

Use inside isolated modular widgets (like menus, sliders, modals) for sizing icons, button paddings, or labels. When the component's base font size scales, the entire component scales proportionally.

4 Mathematical Conversion Formulas

Pixels to REMREM = PX ÷ Base Font SizeExample: 24px ÷ 16px = 1.5rem
REM to PixelsPX = REM × Base Font SizeExample: 2rem × 16px = 32px
EM to PixelsPX = EM × Parent Font SizeExample: 1.2em × 24px = 28.8px

5 Real-World CSS Nesting & Compound Sizing

Below is a practical code example illustrating nested typography. Note how REM remains independent of nesting, whereas EM compounds exponentially relative to parent elements:

CSS Rules
html {
  font-size: 16px; /* Base Root */
}

.card {
  font-size: 1.25rem; /* 1.25 × 16px = 20px */
  padding: 1.5rem; /* 24px padding (rem is stable) */
}

.card-title {
  font-size: 1.5em; /* 1.5 × 20px = 30px (scales with parent) */
  margin-bottom: 0.5em; /* 0.5 × 30px = 15px (relative margins) */
}

.card-desc {
  font-size: 0.875rem; /* 0.875 × 16px = 14px */
}
Visual Demonstration (Base 16px)

Example Heading (.card-title)

This paragraph represents card body text (styled in rem). If you scale the parent font size, this remains aligned, while EM headings adjust relatively.

Overview & Capabilities

Converting pixels into root-relative REM units transforms static Figma vectors and Sketch artboard dimensions into scalable CSS. In frontend architecture and Tailwind CSS spacing systems, hardcoded pixel values break responsive user magnification. Dividing design mockup pixels by the root font base (standard 16px) produces fluid rem tokens that adapt seamlessly across mobile and desktop displays.

Tutorial

How to Use

01
Enter the dimension in Pixels (px).
02
Set the root base font size (defaults to standard 16px).
03
The engine divides pixels by the base size to output exact REM and EM units.
04
Copy the generated CSS snippet (font-size: 1.5rem;) directly into your stylesheet.
Capabilities

Key Features

Configurable root base font size (16px default, 10px 62.5% reset, custom)
UI Typography Presets: 12px (0.75rem), 14px (0.875rem), 16px (1rem), 24px (1.5rem), 32px (2rem), 48px (3rem)
One-click CSS code snippet export
Instant responsive output
Applications

Common Use Cases

Figma to CSS Handoff: Translate 24px component padding and 32px title sizes into 1.5rem and 2rem CSS variables.
WCAG Accessibility: Convert static pixel layouts into relative REM units so typography scales when vision-impaired users zoom browser fonts.
Tailwind & Bootstrap Theming: Map design system pixel scales into standard framework rem spacing classes.
Guidance

Tips & Best Practices

💡
Standard browser root font size is 16px, making 1rem = 16px, 1.5rem = 24px, and 2rem = 32px.
💡
Using REM units for font sizes respects user operating system accessibility text-scaling preferences.
Answers

Frequently Asked Questions

Q What is 24px in rem with 16px base?

24px equals 1.5rem (24 ÷ 16).

Q What is 32px in rem?

32px equals 2.0rem with a standard 16px base.

Q What is 14px in rem?

14px equals 0.875rem.

Q Why should I use REM instead of PX in CSS?

REM units scale proportionally when users adjust their browser font size settings, ensuring accessibility compliance under WCAG 2.1.

Advertisement