PX to REM Converter

Convert pixel values to REM units instantly. Enter your PX value and base font size to get the exact REM equivalent for your CSS — free, no signup required.

Enter a pixel value above to see the REM equivalent

Formula: REM = PX ÷ Base Font Size

What is PX to REM Conversion?

PX (pixels) is a fixed CSS unit — 24px is always 24px regardless of the user's browser settings. REM (Root EM) is a relative unit that scales based on the root element's font size (typically 16px in browsers). Converting PX to REM makes your CSS flexible and accessible.

The formula is simple: REM = PX ÷ Base Font Size. With the default base of 16px, 24px becomes 1.5rem, 32px becomes 2rem, and so on.

How to Use the PX to REM Converter

  1. Enter your pixel value in the Pixel Value (px) field.
  2. Set the Base Font Size — leave it at 16 unless your project uses a custom root font size.
  3. The REM result appears instantly with the full formula shown.
  4. Click Copy to copy the result to your clipboard.
  5. Click Reset to clear all fields and start over.

Why Use REM Instead of PX?

  • Accessibility: REM scales when users increase their browser font size in accessibility settings. PX does not.
  • Responsive design: Changing the root font size with a media query scales your entire layout proportionally.
  • Consistency: REM gives you a single control point — adjust the root size and everything adjusts with it.
  • Modern CSS best practice: Most modern style guides and frameworks recommend REM for font sizes and spacing.

PX to REM Conversion Table

Reference table using the standard 16px base font size.

Pixels (px)REM (base 16px)CSS Usage
4px0.25remborder radius, small spacing
8px0.5remicon size, tight padding
12px0.75remsmall text, captions
14px0.875remsecondary text
16px1rembody text (1rem = base)
18px1.125remslightly larger body
20px1.25remh5, subheadings
24px1.5remh4, card titles
28px1.75remh3
32px2remh2, section headers
40px2.5remh1, hero text
48px3remdisplay text
64px4remlarge display headings

REM vs PX — When to Use Each

Use REM for font sizes, padding, margin, and layout spacing that should scale with user preferences. Use PX for borders, box shadows, and elements where an exact fixed size is required regardless of the user's font settings.

Frequently Asked Questions

What is 1px in REM?

With a default base font size of 16px, 1px equals 0.0625rem. The formula is: REM = PX ÷ Base Font Size.

What is the default base font size for REM conversion?

Most browsers set the default root font size to 16px, which means 1rem = 16px. You can change the base font size in our converter if your project uses a different root font size.

How do I convert PX to REM?

Divide the pixel value by the base font size. For example, 24px ÷ 16 = 1.5rem. Use our free PX to REM converter to get instant results without any manual calculation.

Why should I use REM instead of PX in CSS?

REM units are relative to the root font size, making your design scale proportionally when users change their browser font size settings. This improves accessibility and creates a more responsive layout across all devices.

Can I set a custom base font size?

Yes. Our converter has a Base Font Size input field where you can enter any value. This is useful if your project uses a root font size other than the default 16px.

Is this PX to REM converter free?

Yes, this tool is completely free with no signup, no login, and no hidden charges. Simply enter your pixel value and get the REM result instantly.

Related Developer Tools

Subscribe to the Calcon newsletter

Get new calculators, tools, and practical guides delivered to your inbox. No spam — unsubscribe anytime.

PX to REM Converter – Convert Pixels to REM Online Free - Calcon