Pixel (px) to Rem Converter

Use our pixel to rem converter to convert pixels to rem instantly for responsive CSS. Includes the pixel to rem formula, how to convert px to rem, and why rem is useful for scalable typography and spacing.

Base font size (px)
Default browser font size is usually 16px.
Pixels (px)
Enter a length in pixels.
Results
Rem
Computed as rem = px ÷ base.
0.0625 rem
1px ÷ 16 = 0.0625rem
Did we solve your problem today?

What is Pixel to Rem Conversion?

Px (pixels) are fixed CSS units, while rem is a relative unit based on the root font size (the html element).

If you want a layout that scales consistently across an entire site, converting pixels to rem helps because rem values are tied to the root font size rather than each element’s local font size.

This pixel to rem converter (pixel to rem converter online) lets you convert pixel to rem using a base root size (commonly 16px), which matches how most developers convert px to rem in CSS.

Pixel to Rem Formula

To convert pixels to rem, divide the pixel value by the root font size (in px).

Pixel to rem =
rem = px ÷ rootPx

rootPx is typically 16px by default, but it can be changed in CSS.

Rem to pixels =
px = rem × rootPx

Use this when you know the rem value and want the pixel equivalent.

px
= Pixel value you want to convert
rootPx
= Root font size in pixels (often 16px)
rem
= Root-em unit result
Convert px to rem example (16px root)
24px → 24 ÷ 16 = 1.5rem

A common pixel to rem conversion when the root font size is 16px.

Another example (10px root)
18px → 18 ÷ 10 = 1.8rem

If you set html { font-size: 10px }, rem values scale from 10px.

How to Use the Pixel to Rem Converter

  1. 1

    Enter your root font size (rootPx), in pixels (commonly 16).

  2. 2

    Enter the pixel value (px) you want to convert.

  3. 3

    The converter calculates rem = px ÷ rootPx.

  4. 4

    Use the rem value in your CSS for scalable typography and spacing.

Frequently Asked Questions

How do I convert pixel to rem?

Use the pixel to rem formula: rem = px ÷ rootPx (root font size in pixels).

What is the pixel to rem formula?

rem = px ÷ rootPx, where rootPx is usually 16px by default.

Convert pixels to rem — what root size should I use?

Many browsers default to 16px, but you should use whatever root font size your CSS sets on the html element.

What is px to rem used for?

It helps create consistent, scalable designs. rem is based on the root font size, so spacing and typography scale together.

Is this a pixel to rem converter online?

Yes—this tool converts px to rem instantly based on your chosen root font size.

Is rem the same as em?

No. rem is based on the root (html) font size, while em is relative to the current element’s font size (or parent, depending on the property).