Pixels to REM Converter

Convert pixels to REM units based on root font size.

Save

Calculator

Inputs

Pixel value to convert.

Live output

Results

REM Value
1.5 rem

Report

Export and share

Document

Copy and share

Assumptions

  • The conversion assumes a single root font size for the page or app section you are styling.
  • Results are displayed in REM with rounding that favors readable CSS over excessive decimals.
  • The generated snippet focuses on `font-size`, but the same numeric conversion can apply to spacing and layout values.

Sensitivity preview

Pixels -10%: REM Value 1.35 rem

Pixels Current: REM Value 1.5 rem

Pixels +10%: REM Value 1.65 rem

Related Tools

View All

About this PX to REM

In modern web design, using relative units like REM (Root EM) is essential for accessibility. Unlike fixed Pixels (PX), REM units scale according to the user's browser settings. This calculator helps you translate design mockups (usually in PX) into code-ready REM values.

Who this calculator is for

  • Frontend developers converting design specs into accessible CSS sizing tokens.
  • Design-system teams standardizing spacing and typography around a shared root font size.
  • Anyone migrating a pixel-based stylesheet toward more responsive, user-friendly units.

When to use it

  • Convert typography, spacing, or component dimensions from Figma pixels into REM values.
  • Check how a non-default root size changes your final CSS output before refactoring a component library.
  • Generate a copy-ready `font-size` snippet for documentation or implementation.

How to use this calculator

  1. Enter the Pixel Value you want to convert.
  2. Enter the Root Font Size (Standard browser default is 16px).
  3. Copy the REM Value or the generated CSS snippet.

Key assumptions

  • The conversion assumes a single root font size for the page or app section you are styling.
  • Results are displayed in REM with rounding that favors readable CSS over excessive decimals.
  • The generated snippet focuses on `font-size`, but the same numeric conversion can apply to spacing and layout values.

Accuracy and testing

Review formula sources, default test cases, assumptions, unit handling, rounding rules, and changelog for this calculator.

View accuracy page

How this calculator works

REM = Pixels / Root Font Size If your root size is 16px (default), then 16px = 1rem, 24px = 1.5rem, and 32px = 2rem.

Inputs explained

Pixels (px)

The fixed unit value from your design software (Figma, Sketch).

Root Size

The base font-size defined in your CSS `html` selector. Defaults to 16px in almost all browsers.

Understanding your results

The result is the relative size. Using this ensures that if a visually impaired user increases their browser's default font size, your layout scales up proportionally.

Example scenarios

Standard Text

16px / 16 = 1rem.

Heading

32px / 16 = 2rem.

Tailwind Config

14px / 16 = 0.875rem.

Key Features

  • Bidirectional calculation
  • Custom root size support
  • CSS snippet generation

Tips & Best Practices

  • Set `html { font-size: 16px; }` explicitly if you want to guarantee 1rem = 16px, though leaving it to the browser default is better for accessibility.
  • Avoid the '62.5%' hack (setting root to 10px) if possible, as it can confuse third-party components.

Glossary of Terms

REM
Root EM. A unit relative to the font-size of the root element (html).
EM
A unit relative to the font-size of the parent element.
Accessibility (a11y)
Designing software so it can be used by people with disabilities.

Frequently Asked Questions

Why should I use REM instead of Pixels?
REM units allow users to scale the size of text and elements by adjusting their browser's default font size. This makes your website accessible to visually impaired users who need larger text.
What is the default root font size?
Most modern browsers have a default root font size of 16px. This means 1rem equals 16px by default unless changed in the CSS.
What is the difference between REM and EM?
REM is relative to the root (html) font size, while EM is relative to the font size of the parent element. REM is generally more predictable for sizing layout elements.
How does this help with Accessibility?
When you use pixels, text size is fixed. When you use REM, if a user sets their browser's base font size to 'Large' (e.g., 20px), your site scales up automatically to meet their needs.
Do all browsers support REM units?
Yes, all modern browsers (Chrome, Firefox, Safari, Edge) fully support REM units. It has been a standard since IE9.