Pixel to REM Converter

Convert PX to REM (and EM) instantly with a custom root font size — live, bidirectional, and ready-to-paste as CSS. Convert one value or a whole list at once.

  • Live Bidirectional
  • Custom Base Size
  • Bulk Convert
  • CSS Snippet Ready
  • 100% Private
Convert PX ⇄ REM ⇄ EM
Browsers default the root (<html>) font size to 16px — change this only if your site overrides it.
Pixels
px
REM
rem
EM
em
Enter a value to see the formula.
font-size: 1rem; /* 16px */
PXREMEM
Paste one or more pixel values above to convert them all at once.

Click any row to load that value into the Convert tab.

PXREMEM

Built for Real CSS Workflows

Everything the other converters have, plus the parts they're missing.

  • Live & Bidirectional

    Type into PX, REM, or EM — the other two update instantly. No convert button, no page reload.

  • Custom Root Font Size

    Defaults to the browser standard 16px, but adjusts for sites using a different root — including the 62.5% (10px) trick.

  • Bulk Convert

    Paste an entire design spec's worth of pixel values and get every REM/EM equivalent at once.

  • CSS-Ready Output

    Pick a CSS property and copy a complete, ready-to-paste declaration — or export a whole list as CSS custom properties.

  • Full Reference Table

    A complete px-to-rem chart from 2px to 128px, recalculated live for your chosen base — click any row to load it.

  • 100% Private

    Every calculation runs in your browser. Nothing you type is ever sent to a server.

Convert in Seconds

  1. 1

    Set the Root Font Size

    Leave it at 16px (the browser default) or match your project's actual root size.

  2. 2

    Type a Value

    Enter pixels, rem, or em — or paste a whole list into Bulk Convert.

  3. 3

    Copy the Result

    Copy the raw value, or a ready-to-paste CSS declaration for any property.

Frequently Asked Questions

rem = pixels ÷ root font size. The root font size defaults to 16px in every major browser, so 24px ÷ 16 = 1.5rem. This tool lets you change the base if your site sets a different root size.

rem is always relative to the root (<html>) font size, so it stays consistent everywhere on the page. em is relative to the current element's parent font size, so it can compound when elements are nested inside each other with different font sizes.

16px is the default font-size every major browser applies to the <html> element unless a stylesheet overrides it. That's why 16px is the standard base for px-to-rem conversion.

Accessibility. If a user increases their browser's default font size for readability, values in rem scale proportionally with that setting, while values in px stay fixed and can break a resized layout. This is also part of WCAG 1.4.4 (Resize Text).

No — the base font size field here only affects the calculation shown on this page. To change your site's actual root size, set font-size on the html selector in your own CSS.

Usually not. Hairline details like 1px borders are typically kept in raw px since they don't need to scale with the user's text-size preference. rem and em are best reserved for typography, spacing, and layout dimensions.

Yes — this converter is fully bidirectional. Type into the REM or EM field and the PX field updates instantly using px = rem × base font size.

Yes — switch to the Bulk Convert tab, paste a list of pixel values separated by commas, spaces, or line breaks, and get every rem and em equivalent instantly, with a one-click copy as a plain list or as CSS custom properties.

PX to REM Conversion Chart (16px Base)

PixelsREMEM
8px0.5rem0.5em
10px0.625rem0.625em
12px0.75rem0.75em
14px0.875rem0.875em
16px1rem1em
18px1.125rem1.125em
20px1.25rem1.25em
24px1.5rem1.5em
32px2rem2em
40px2.5rem2.5em
48px3rem3em
64px4rem4em

Need a different base, or a value that isn't in this chart? Use the Reference Table tab in the converter above — it covers 2px to 128px and recalculates live for any root font size, including the 62.5% "10px" trick some design systems use.

PX vs. REM vs. EM — What's the Difference?

UnitRelative ToScales With Browser Text Size?Best For
pxAbsolute (fixed)NoBorders, hairlines, fixed icon sizes
remRoot (<html>) font sizeYesTypography, spacing, layout dimensions
emParent element's font sizeYesSizing relative to a specific component (e.g. icon next to text)

px is an absolute CSS unit — 16px is 16px everywhere, regardless of any font-size setting. rem ("root em") is always relative to the root <html> element's font-size, so a value like 1.5rem means the same thing no matter where it's used in the page. em is relative to the current element's own (inherited) font-size, which makes it compound inside deeply nested elements — useful for scaling something relative to its immediate container, but easy to lose track of in complex layouts. For a deeper walkthrough, read our full guide to px vs. rem vs. em in CSS.

When Should You Use REM Instead of PX?

Use rem for anything that should respect the user's accessibility preferences — font sizes, margins, padding, and layout widths. When someone increases their browser's default text size (common among users with low vision), every rem value on the page scales proportionally, while px values stay exactly the same size and can start to look cramped or misaligned next to the now-larger text. This is part of why WCAG 1.4.4 (Resize Text) recommends against text sizing methods that prevent this kind of scaling. Reserve px for details that genuinely shouldn't scale, like a 1px hairline border.

A Note on Non-Standard Root Font Sizes

Most frameworks — including Tailwind CSS and Bootstrap — assume the browser's default 16px root font size when defining their rem-based spacing and type scales. Some older design systems instead set html { font-size: 62.5%; }, which makes the root exactly 10px — a trick that turns rem math into simple mental division by 10 (16px becomes 1.6rem, 24px becomes 2.4rem). If you're auditing or migrating a codebase, always confirm the actual root font-size in its global stylesheet before trusting a 16px assumption; the base font size field in the converter above lets you match either convention exactly.