Pixel Converter

Convert between px, rem, em, pt, and vw/vh CSS units.

Converted value

1rem

16px ÷ 16px = 1rem

Input

16px

The value you entered.

Root size

16px

The base font size used for conversion.

CSS snippets

Copy-ready examples using the converted value.

font-size: 1rem;
padding: 1rem;
margin-bottom: 1rem;
--space-custom: 1rem;

Live preview

Typography and spacing preview. Large values are visually capped so the preview does not break the page.

Typography preview

Scalable text

Actual calculated size: 16px. Preview display is capped between 12px and 88px to keep the layout stable.

Spacing preview using the converted scale.

Common conversions

How it works

PX and REM formulas

The conversion is simple once you know the root font size. Most browser defaults use 16px.

PX to REM

rem = px ÷ root font size

Use this when converting fixed pixel values into scalable rem units.

REM to PX

px = rem × root font size

Use this when checking what a rem value equals in pixels at a specific root size.

Guidance

When to use rem instead of px

Typography

Use rem for font sizes so text scales more predictably from the root font size.

Spacing

Use rem for padding, margins, and layout spacing when you want scalable rhythm.

Accessibility

rem units can support users who adjust browser or system text settings.

Responsive design

rem values work well with design systems, CSS variables, and responsive layouts.

Insights

Conversion notes

16px equals 1rem.
Using a 16px root font size.
REM units help layouts scale with browser text settings.
Typography systems often combine rem units with CSS variables.
PX to REM conversion divides the pixel value by the root font size.

FAQ

Pixel converter questions

A pixel to rem converter changes fixed pixel values into scalable rem units using the selected root font size.