Skip to content

rem is a multiple of the root font size

Convert px and rem

rem is relative to the root font size, not to the parent. This page divides or multiplies by the root you set.

The default root is 16, which is the usual browser default. If your document sets a different font-size on the root element, change the root here to match it. Editing pixels updates rem, and editing rem updates pixels. The result is rounded to four decimal places for display. The page does not read your stylesheet.

The arithmetic stays in this tab.

This tool runs in your browser. Turn on JavaScript to use it.

The browser default

At a 16px root, one rem is 16 pixels. 24 pixels is one and a half rem.

Root
16
24px
1.5rem

How to use it

  1. 1Set the root font size. Leave 16 if you have not changed it.
  2. 2Type pixels or rem.
  3. 3Copy the other value.

Good to know

  • rem uses the root, not the parent.
  • The page does not inspect a CSS file.
  • Results are rounded to four decimal places.

Questions

Why is 16 the default?

Browsers use 16px for the root font unless a page changes it.

Is this em or rem?

rem. em would depend on the parent, which this page does not know.

Can the root be zero?

No. Division by zero is rejected.

Related tools

  • Convert a color

    The same color is written as hex, RGB, or HSL depending on the file. This page parses one of those forms and prints the other two.

  • Convert binary, octal, decimal, and hex

    255, 0xFF, and 11111111 are one integer written three ways. This page keeps that integer exact and shows the other spellings beside the field you edit.

  • Sort, trim, and count lines

    Lists in a text box are awkward to clean by hand. This page trims, filters, sorts, or reverses the lines, and always shows the counts.