px ↔ rem converter

Convert pixel values to rem and back against your root font size.

Converted in this browser. Nothing is sent anywhere.

Root size accepts 1–100px (browsers default to 16). Results round to 4 decimals. Nested elements inherit their own font-size, so rem depends on the root only.

How to use

  1. Choose the direction.
  2. Set the root font size if it is not 16px.
  3. Enter the value and copy the result.

What it supports

rem always refers to the root element — a component-level font-size does not change it. Results round to 4 decimals; line-height and layout can still differ from the math.

Related tools

Related guides