PX to REM Converter

PX to REM Converter — convert pixels to scalable REM/EM in one step; this px to rem calculator also supports pixel to em for component-level sizing.
1 rem = root font-size (typically 16px): rem = px ÷ base. Get fast, accessible typography from fixed specs with our px to rem converter.

REM to PX PX to REM




 

PX to REM Converter — Pixel to EM Calculator

Use this px to rem converter and px to rem calculator to turn fixed pixels into scalable units — pixel to em/rem — instantly.

1 rem equals the root font-size (typically 16px). Conversion: rem = px ÷ base for consistent, accessible typography and spacing.

How to calculate px to rem online (px to rem converter)

Choose a base (root font-size), enter a value, then switch the mode to convert
px → rem, rem → px, or pixel to em instantly.

Base 16px
14px
15px
18px
20px
Custom
Mode:
PX → REM
REM → PX
PX → EM

Inputs
  • Base (root font-size) — pick a preset (16/14/15/18/20) or type a custom value.
  • Value — enter a number and choose the conversion mode (PX ⇄ REM/EM).
Outputs
  • PX → REM: rem = px ÷ base
  • REM → PX: px = rem × base
  • PX → EM: em = px ÷ current font-size
  • Results show with sensible decimals; copy-ready formats (e.g., 1.25rem).
Actions

Note: 1 em is relative to the parent element’s font-size, while 1 rem is relative to the root (html) font-size. That’s why rem is preferred for global, accessible typography.

Formula (PX → REM & REM → PX)

PX → REM
rem = px ÷ base

base = root font-size (html), typically 16px.

REM → PX
px = rem × base

This is the answer to “what is the formula for rem to px?”

PX ↔ EM
em = px ÷ current font-size
px = em × current font-size

em depends on the parent element; rem depends on the root.

By default, browsers use a root font-size of 16px, so 1rem = 16px. If you change the root size
(e.g., in CSS or via media queries), the base updates and the px → rem math adapts automatically.
That’s why using rem makes designs responsive and accessible.

For quick work, this page shows exactly how to calculate px to rem online: pick the base, enter pixels,
and the converter returns rem = px ÷ base instantly.

Tip: at base 16px → 12px = 0.75rem · 14px = 0.875rem · 24px = 1.5rem · 32px = 2rem.

Quick Examples (Base 16px)

At base 16px, rem = px ÷ 16. These badges show common conversions for fast copy.


1px0.0625rem


10px0.625rem


12px0.75rem


14px0.875rem


16px1rem


18px1.125rem


20px1.25rem


24px1.5rem


28px1.75rem


30px1.875rem


32px2rem


100px6.25rem

Handy lookups: 1 px to rem, 16px to rem, 18px to rem, 24 px to rem, 32px to rem, 100 px to rem.

PX to REM List (Base 16px)

Quick px to rem list for common values. Change the base to match your project (14px / 18px).

Base 16px
Base 14px
Base 18px
REM → PX (16px)
PX (16px base)REM
20.125
40.25
60.375
80.5
100.625
120.75
140.875
150.9375
161
181.125
201.25
241.5
281.75
301.875
322
362.25
402.5
483
563.5
644
PX (14px base)REM
20.1429
40.2857
60.4286
80.5714
100.7143
120.8571
141
151.0714
161.1429
181.2857
201.4286
241.7143
282
302.1429
322.2857
362.5714
402.8571
483.4286
564
644.5714
PX (18px base)REM
20.1111
40.2222
60.3333
80.4444
100.5556
120.6667
140.7778
150.8333
160.8889
181
201.1111
241.3333
281.5556
301.6667
321.7778
362
402.2222
482.6667
563.1111
643.5556
REM (base 16px)PX
0.254
0.58
0.7512
116
1.2520
1.524
232

REM vs EM vs PX — When to use each?

  • REM — best for global typography and page-wide spacing. Scales from the root
    font-size, so designs are responsive and accessible by default.
  • EM — great inside a component when you want sizes to scale relative to the parent
    (e.g., buttons, cards). Remember it’s cumulative: nested elements multiply the parent’s size.
  • PX — use sparingly for truly fixed items (pixel-perfect icons, hairline borders). Avoid for
    text sizes and layout spacing.
Heads-up on html { font-size: 62.5%; }

Setting the root to 62.5% (10px base) can simplify math (1rem = 10px), but it may reduce readability for users
who rely on browser zoom or OS text scaling. If you use it, audit accessibility and test zoom/contrast thoroughly.

Tip: For most projects, prefer rem for type/spacing, reserve em for
component-relative tweaks, and keep px for precise, non-scaling details.

Practical Use-Cases

  • Figma → CSS handoff — translate pixel specs from design to scalable CSS using the
    px to rem calculator.
    Keep typography and spacing consistent across breakpoints.
  • Unified spacing scale — replace ad-hoc pixel values with a REM-based scale
    (e.g., 0.25rem, 0.5rem, 1rem, 1.5rem). Improves rhythm, readability, and theming.
  • Legacy CSS migration — convert fixed pixels to REM for text and layout while keeping icons/borders
    in PX where precision matters. Use the tool to convert pixel to em if a component must inherit the parent size.
  • Design systems — define tokens in REM (font-sizes, line-heights, spacing).
    Changing the root font-size updates the whole system responsively.
  • Accessibility & responsiveness — users who zoom or prefer larger text benefit when sizes scale with REM.
    Media queries can adjust the root size for small/large screens.
  • Theming & multi-brand — swap base (root) font-size or scale tokens to match different brands without rewriting component CSS.

Tip: Start by converting your most common pixel values (e.g., 12, 14, 16, 20, 24, 32) with the px to rem converter, then roll out the scale across typography and spacing.

How to calculate PX to REM online

Follow these quick steps in our px to rem converter to turn pixels into scalable REM/EM values.

  1. Choose a base (root font-size) — pick a preset 16/14/15/18/20 or type a custom value.
  2. Enter your value — type the number and select the mode: PX → REM, REM → PX, or PX → EM.
  3. Read the result — the tool applies rem = px ÷ base (and for EM: em = px ÷ current font-size).
  4. Copy or Share — copy the output (e.g., 1.25rem) or share a URL with your parameters.
  5. Try the reverse — need pixels from rem? Open REM → PX. Want EM specifically? Use PX → EM.

Default browsers use 16px root, so 1rem = 16px. If your project changes the root size (e.g., media queries), the conversion updates automatically.

Popular font sizes — PX ⇄ REM (Base 16px)

12 → 0.75rem
14 → 0.875rem
16 → 1rem
18 → 1.125rem
20 → 1.25rem
24 → 1.5rem
28 → 1.75rem
32 → 2rem

FAQs — PX to REM & Pixel to EM

How do you convert px to rem?

rem = px ÷ base. Example: 24 ÷ 16 = 1.5rem.

What is the formula for rem to px?

px = rem × base. If the root base is 16px, 1.25rem × 16 = 20px.

How many px is 1 rem?

It depends on the root base. With the default browser base 16px, 1rem = 16px.

What is 24 px in rem?

At base 16px: 24px = 1.5rem.

How many px makes a rem?

The base value (root font-size). If base = 16px, then 1rem = 16px; if base = 20px → 1rem = 20px.

Pixel to EM vs REM?

em is relative to the parent element’s font-size. rem is relative to the root (html) font-size. Use rem for global type/spacing; em for component-relative scaling.

Quick one-liners (base 16px)

  • 16px → 1rem18px → 1.125rem20px → 1.25rem
  • 12px → 0.75rem14px → 0.875rem24px → 1.5rem
  • 30px → 1.875rem32px → 2rem
  • 10px → 0.625rem13px → 0.8125rem100px → 6.25rem

Tip: Use our px to rem calculator for custom bases and instant pixel to em as well.


Related tools & internal links

Tip: The px to rem converter supports custom bases (14/15/18/20+).

External reference:

Wikipedia — CSS values and units (rem, em)