Frontend ToolsA little help for every day

Search by name or task, such as JSON or percentage.

Frontend Tools

PX to REM Converter (and REM to PX)

Convert px to rem and back using any root font size, plus em, % and pt. 24px is 1.5rem at the default 16px root, and a px to rem chart is included.

View all tools
ResultUpdates as you type
Result24px = 1.5rem
UnitValue
px24
rem ✓1.5
em1.5
%150
pt18

Common px sizes in rem with a 16px root font size:

pxrem
10px0.625rem
12px0.75rem
13px0.8125rem
14px0.875rem
15px0.9375rem
16px1rem
18px1.125rem
20px1.25rem
24px1.5rem
28px1.75rem
32px2rem
40px2.5rem
48px3rem
64px4rem

How to use PX to REM Converter (and REM to PX)

Enter a value, choose the units to convert from and to, and set the root font size, 16px by default. For em and %, add the parent font size if it differs from the root. The swap button reverses the direction.

  1. Enter the value and unitsType the number and choose From and To among px, rem, em, % and pt; use swap to reverse them.
  2. Set the font sizesRoot font size is the base for rem; Parent font size is the base for em and % and defaults to the root.
  3. Read the result and chartSee the converted value, the same size in every unit, and a px to rem chart of common sizes.

The px to rem formula, with examples

rem is relative to the font size of the root html element, so rem = px ÷ root size and px = rem × root size. With the browser default of 16px, 12px is 0.75rem, 14px is 0.875rem, 18px is 1.125rem and 24px is 1.5rem. If the root font size is set to 10px, 1.5rem becomes 15px. pt is a print unit where 1pt equals 4/3 px, so 18pt equals 24px. The results table shows the same size in px, rem, em, % and pt, and the chart lists 14 common px sizes in rem for the root size you entered.

rem vs em vs %

A rem means the same everywhere on the page because it always refers to the root size. em and % refer to the parent element's font size, so they compound when nested: 1.5em inside a 20px parent is 30px, and another 1.5em inside that would be 45px. That's why there's a separate parent size field, which falls back to the root size when left blank. Sizing text and spacing in rem means everything scales together when someone raises their browser's default font size, which helps accessibility.

Accuracy and data handling

After adding generated code to a project, test it in the target browsers and responsive sizes. The calculation runs in your current browser; the tool code does not send the input to a processing API.

Often Used Together

Next step

FAQ

How many px is 1rem?

It depends on the root font size. Browsers default to 16px, so 1rem is 16px unless the html element's font-size is changed; with a 10px root, 1rem is 10px.

How do I convert px to rem?

Divide the px value by the root font size. At 16px, 18px ÷ 16 = 1.125rem. Here, choose px to rem and enter 18.

Why do em and rem give the same result?

When the parent font size is left blank, it's assumed to equal the root size, so 1em equals 1rem. Enter the real parent size to see the em and % values change.

More Frontend Tools

Related tools