Unit-To-Unit Pixels conversion www.cupandgear.com

PX to REM

1 CSS pixel = 0.0625 rem

Dividing by the root font size is the core of accessible CSS sizing: a layout in rem scales when a user raises their browser text size, while one in px does not. The default root is 16 px, and this converter lets you set your own.

Formula rem = px × 0.0625

=

Type in either field — the other updates on every keystroke. Need other units? Open the full pixels converter.

PX to REM — quick reference
CSS pixelRoot em
1 px0.0625 rem
2 px0.125 rem
3 px0.1875 rem
4 px0.25 rem
5 px0.3125 rem
10 px0.625 rem
15 px0.9375 rem
20 px1.25 rem
25 px1.5625 rem
50 px3.125 rem
100 px6.25 rem
500 px31.25 rem
1000 px62.5 rem
REM to PX — reverse
Root emCSS pixel
1 rem16 px
2 rem32 px
3 rem48 px
4 rem64 px
5 rem80 px
10 rem160 px
15 rem240 px
20 rem320 px
25 rem400 px
50 rem800 px
100 rem1600 px
500 rem8000 px
1000 rem16000 px

Worked examples

Common values
SituationFromTo
Small caption text12 px0.75 rem
Small text14 px0.875 rem
Default body text16 px1 rem
Large body text18 px1.125 rem
Subheading24 px1.5 rem
Page heading32 px2 rem

Pixels to rem in everyday use

Designers specify sizes in pixels, but accessibility guidance favours rem, which scales with the user's font-size setting.

Browsers set the root font size to 16 px by default, so 16 px is 1 rem, 14 px is 0.875 rem, 18 px is 1.125 rem, 24 px is 1.5 rem and 32 px is 2 rem. Designers hand over sizes in pixels and developers write them in rem so text scales with the user's own font settings, which matters for accessibility.

Some stylesheets set the root size to 62.5 percent, which makes 1 rem equal 10 px and turns the maths into moving a decimal point. If a project does that, change the root font size in the converter above and every result on this page follows it. Use rem for text and spacing that should scale, and px for hairline borders and fixed-size icons.

Mental-math shortcut and common mistakes

Divide by 16. For 24 px: 24 ÷ 16 = 1.5 rem.

Fixed px font sizes ignore user preferences.

Background

The CSS pixel is a reference unit defined as 1/96 inch, not a hardware pixel. The rem unit (root em) arrived with CSS3 to avoid the compounding that em units suffer in nested elements.

Best tools for working in px and rem

No purchase is needed here. The most accurate tools are free ones built into your browser and design software, and they show rem values from the real stylesheet instead of a calculation.

What to look for
ToolWhat to look forWhy it matters
Browser developer toolsComputed styles pane shows the final pixel size, and you can edit values liveConfirms what a rem value resolves to on a real page
Design tools such as FigmaCan display sizes in px and set a base font sizeKeeps designer and developer on one unit
A CSS custom property for the base sizeOne variable used across the stylesheetChanging the root size updates every rem value together

Quick accuracy check. Open developer tools, select the html element and check the computed font-size. That is the number to use as 1 rem in your conversion.

Examples: Chrome DevTools, Firefox Developer Tools and Safari Web Inspector are free and ship with the browser. Product names are examples of established brands, not rankings or paid placements. Specifications and prices change, so check current independent reviews before you buy.

Learn more

Related guides: Digital and print layout units: px, rem, em, points and DPI · Unit conversion formulas by category · Where unit conversions come up in daily life

Frequently asked

How many rem are in a CSS pixel?
1 CSS pixel = 0.0625 rem. In the other direction, 1 rem = 16 CSS pixels.
What is a CSS pixel?
A CSS pixel is a reference unit of 1/96 inch, not a physical device pixel. Browsers scale it by the device pixel ratio, so one CSS pixel may cover four hardware pixels on a 2× display.
What is a rem?
A rem is the root element’s font size — 16 px in every browser by default, though stylesheets frequently override it. Sizing in rem lets a whole layout scale with the user’s chosen text size.
What is 1 rem in px?
16 px by default, because browsers set the root font size to 16 px.