PX to REM Converter

Type a pixel value to get rem and em, or a rem value to get pixels. Change the root font size (16px in browsers by default) and the parent size for em, and copy the CSS value.

Convert
px
px

Browsers default to 16px.

px

rem

1.5rem

em (in this parent)

1.5em

Percent of root

150%

Common sizes at a 16px root

Pixelsrem
10px0.625rem
12px0.75rem
14px0.875rem
16px1rem
18px1.125rem
20px1.25rem
24px1.5rem
28px1.75rem
32px2rem
40px2.5rem
48px3rem

Features

  • px to rem, em and percent

  • rem and em back to px

  • Any root and parent font size

  • Table of common sizes from 10 to 48px

  • Copy the value for your CSS

When to use it

Converting a design

Turn pixel sizes from a Figma or Adobe XD file into rem for accessible CSS.

Refactoring old CSS

Replace fixed px font sizes and spacing with rem so text grows with the user's browser setting.

Nested components

Work out an em value when a component sits inside a parent with its own font size.

Frequently Asked Questions

Worked example

A design uses a 24px heading and 14px body text, and the site keeps the browser's 16px root.

  • Heading: 24 ÷ 16 = 1.5rem
  • Body: 14 ÷ 16 = 0.875rem
  • Inside a card with a 20px font size, 24px is 24 ÷ 20 = 1.2em

More for developers: Viewport Unit Calculator, 8px Grid Calculator, Color Converter, CSS Minifier.