PX to REM Converter

Enter a pixel value and get the rem equivalent instantly, using whatever root font size your project sets (16px by default). Because rem scales with the user's browser font setting, converting fixed px values to rem keeps typography and spacing accessible and responsive. The table below lists the most common px-to-rem values at a 16px base so you can copy them straight into your CSS.

Pixel to rem at a 16px root font size

PixelsREM
4px0.25rem
8px0.5rem
12px0.75rem
14px0.875rem
16px1rem
18px1.125rem
20px1.25rem
24px1.5rem
32px2rem
40px2.5rem
48px3rem
64px4rem

When to use it

  1. Translate a Figma or PSD spec given in pixels into rem for responsive CSS.
  2. Make font sizes respect the user's browser zoom and accessibility settings.
  3. Standardise spacing on a design system that uses rem units.

How to Use

  1. Type your pixel value into the PX field — for example, 24.
  2. The REM equivalent appears instantly in the REM field on the right.
  3. If your project's root font-size isn't 16px (the browser default), change the Root Font Size below.
  4. Use the reference table for common pixel values like 14px, 16px, 24px, and 32px at a glance.
  5. Click the copy icon next to either field to lift the value straight into your CSS or design tokens file.

Features

  1. Default 16px root font-size matches the browser default — works out of the box
  2. Configurable root font-size for projects using 10px or 18px bases
  3. Reference table with the 17 most common pixel values used in UI work
  4. Bidirectional — type px and get rem, or type rem and get px
  5. Browser-only — no design system data ever uploaded

FAQs

Why convert pixels to rem in CSS?

Rem (root em) makes typography and spacing scale with the user's browser font-size preference, which is essential for accessibility. A user who has bumped their default font size up to 20px (because of low vision, for example) will see your whole layout scale proportionally if you size in rem instead of px. Sites that hardcode 14px text remain stuck at 14px no matter what the user does. Switching to rem also makes responsive resizing trivial — change the html font-size at a breakpoint and the whole UI rescales.

What is the default rem base size?

Browsers default the root font-size to 16px, so 1rem = 16px out of the box. Many designers use this assumption — multiples of 16. Some teams set the html element to font-size: 62.5% (which makes 1rem = 10px) so the math is easier: 24px = 2.4rem, 12px = 1.2rem. This calculator lets you change the base in the field above to match your project. The default of 16 covers most setups.

Should I use rem for everything?

Use rem for font-size, padding, margin, gap, max-width, and border-radius — anywhere a user-controlled scale should apply. Use px for borders (1px hairlines), box-shadow blur, and a handful of pixel-perfect details. For element widths and breakpoints, em (relative to the element's own font-size) is sometimes a better fit. Avoid using rem for media-query widths in older browsers; modern browsers handle it fine.

How accurate is the conversion?

Exact to four decimal places — more than enough for any CSS use case (browsers round subpixel values to fractions of a logical pixel anyway). At the default 16px base, 1px = 0.0625rem, 14px = 0.875rem, 24px = 1.5rem. The calculator stores the full precision internally so chained calculations don't accumulate rounding error.

Technical Details

REM (root em) is a CSS relative unit defined as a multiple of the document's root font-size. The conversion is: rem = px / rootFontSize (default 16px). The tool uses bidirectional React state — editing either input field recalculates the other — with the root font-size configurable to match project-specific base values. A reference table pre-computes common pixel values using the active base.

Calculators & Converters

Calculators & Converters

  • REM to PX Converter
  • PX to EM Converter
  • EM to PX Converter
  • PX to Percentage Converter
  • Percentage to PX Converter
  • Base Unit to PX Converter
  • PX to Base Unit Converter
  • PX to Tailwind Converter