PX to REM Converter

Convert px to rem and rem to px instantly. Set a custom base font size for accurate results.

Free Runs in your browser
Base font size:
px
(default: 16px — browser root font size)
px
rem
rem = px ÷ 16px  |  px = rem × 16px
pxrem
8px0.5 rem
10px0.625 rem
12px0.75 rem
14px0.875 rem
16px1 rem
18px1.125 rem
20px1.25 rem
24px1.5 rem
32px2 rem
48px3 rem
64px4 rem
96px6 rem

How to use

  1. 1 Enter a pixel value (e.g. 16) in the PX field — the REM equivalent updates instantly based on your configured base font size.
  2. 2 Alternatively, enter a REM value (e.g. 1.25) in the REM field — the pixel equivalent is computed in real time.
  3. 3 Adjust the base font size (default 16px) using the number input to match your CSS :root font-size if your project uses a different value (e.g. 62.5% = 10px).
  4. 4 Use the quick-reference table to look up common PX values and their REM equivalents at a glance — ideal for spacing, typography, and layout sizing.
  5. 5 Copy the REM value into your CSS or component library. Using REM ensures your design scales with user accessibility preferences.

Key features

  • Bidirectional conversion: PX → REM and REM → PX with real-time synchronous updates as you type
  • Adjustable base font size (default 16px, range 1–100px) to match your CSS :root font-size configuration
  • Quick-reference table of 12 common PX spacing values with their REM equivalents at your current base
  • Formula display shows the exact calculation: rem = px ÷ base and px = rem × base
  • Essential for building accessible, scalable responsive UIs — REM units respect user browser font-size preferences

What are PX and REM Units?

PX (pixels) is the most fundamental CSS unit — one pixel corresponds to one physical pixel on the screen. While intuitive for designers, pixel-based sizing is absolute: it ignores the user's browser font-size settings, making it a poor choice for accessibility.

REM stands for "Root EM" — it is a relative unit based on the font-size of the root element (<html>). By default, browsers set this to 16px, but users can change it in their browser settings. When you use REM, your entire layout scales proportionally — making your site more accessible and responsive.

Modern CSS frameworks like Tailwind CSS, Bootstrap 5, and Chakra UI have adopted REM as their default spacing unit precisely because of this accessibility benefit.

Common Use Cases

Building accessible websites

Use REM units so your entire UI scales when users change their browser default font size — meeting WCAG 1.4.4 requirements.

Responsive design systems

Define spacing, typography, and component sizes in REM to create a scalable system that responds to a single root font-size change.

Tailwind / Bootstrap projects

Both frameworks default to REM-based spacing utilities. Convert your design tokens from Figma (PX) to REM for consistent implementation.

Migrating legacy CSS to REM

Convert existing pixel-based CSS to REM units incrementally — this tool helps you find the exact REM value for each PX measurement.

Custom root font-size setups

Some projects use a non-standard base (62.5% = 10px, or 18px for larger typography). Adjust the base font-size to match your configuration.

Design-to-code handoff

Convert pixel measurements from Figma, Sketch, or Adobe XD into REM values ready for your CSS or component library.

Quick Conversion Reference

Common PX values and their REM equivalents at different base font sizes.

PXREM (14px base)REM (16px base)REM (18px base)
4px0.2857 rem0.25 rem0.2222 rem
8px0.5714 rem0.5 rem0.4444 rem
10px0.7143 rem0.625 rem0.5556 rem
12px0.8571 rem0.75 rem0.6667 rem
14px1 rem0.875 rem0.7778 rem
16px1.1429 rem1 rem0.8889 rem
18px1.2857 rem1.125 rem1 rem
20px1.4286 rem1.25 rem1.1111 rem
24px1.7143 rem1.5 rem1.3333 rem
32px2.2857 rem2 rem1.7778 rem
40px2.8571 rem2.5 rem2.2222 rem
48px3.4286 rem3 rem2.6667 rem
64px4.5714 rem4 rem3.5556 rem
96px6.8571 rem6 rem5.3333 rem
128px9.1429 rem8 rem7.1111 rem

Why Prefer REM Over PX?

AspectPXREM
AccessibilityIgnores user's browser font-size settingsScales with user preferences
ScalabilityFixed — does not adapt to viewportProportional — change one value, everything scales
PredictabilityAlways identical regardless of contextDepends on root font-size
Best for1px borders, box-shadows, fine detailsFont sizes, spacing, layout widths, padding, margins

WCAG Success Criterion 1.4.4 (Resize Text) requires that text can be resized up to 200% without loss of content or functionality. Using REM instead of PX is the simplest way to meet this requirement.