Convert pixels to REM and REM to pixels for responsive CSS. Set any base font size and instantly see conversions. Includes a reference table of common px-to-rem values.
Enter a pixel value in the left field to convert it to REM, or enter a REM value in the right field to convert it to pixels.
Set the base font size (usually 16px, which is the browser default). If your root font size is different, update this field.
The conversion appears instantly in the output box. A quick reference table for common sizes is also shown.
REM (Root EM) is a CSS unit that is relative to the font size of the root element (html). By default, most browsers set the root font size to 16px, which means 1rem = 16px. Using REM units instead of pixels makes your design responsive to user font size preferences and simplifies scaling the entire interface by changing a single value.
To convert px to rem: rem = px ÷ base font size
To convert rem to px: px = rem × base font size
Example: 24px ÷ 16 = 1.5rem
px (pixels) is absolute — 16px always means exactly 16 pixels regardless of any settings.
rem (Root EM) is relative to the <html> root font size. Browser default: 1rem = 16px. Critical advantage: when users increase browser font size for accessibility, rem-based layouts scale correctly — px layouts stay fixed.
Formula: rem = px ÷ base font size. At the default 16px base:
8px = 0.5rem · 12px = 0.75rem · 14px = 0.875rem16px = 1rem · 24px = 1.5rem · 32px = 2rem48px = 3rem · 64px = 4rem · 96px = 6remUse the free CSS unit px to rem calculator above — enter any value for instant results + reference table.
4 key reasons to use rem over px:
clamp()Browser default is 16px. Common CSS approaches:
html { font-size: 16px; } — explicit defaulthtml { font-size: 62.5%; } — makes 1rem = 10px (easy math)html { font-size: 100%; } — respects user settings ✅ recommendedUpdate the base field in our converter — all conversions recalculate instantly.
Tailwind uses rem with 16px base. Common Tailwind values:
p-1 = 0.25rem = 4px · p-4 = 1rem = 16px · p-8 = 2rem = 32pxtext-sm = 0.875rem = 14px · text-base = 1rem = 16pxtext-xl = 1.25rem = 20px · text-2xl = 1.5rem = 24pxFor custom values: use our Tailwind px to rem calculator → apply as text-[1.375rem].
em — relative to the current element's font size. Can compound in nested elements (1.5em × 1.5em child = 2.25em — unpredictable!).
rem — always relative to the root html font size. Consistent and predictable everywhere.
Use rem for global sizing. Use em only for component-relative spacing.
At the standard 16px base font size:
1rem · 24px = 1.5rem · 32px = 2remEnter any value into our free pixel to rem converter above for instant result + reference table.