PX to REM converter

Convert pixels to rem and rem to pixels for CSS.

  • CSS
  • 100% free & unlimited
  • Runs in your browser
PX to REM converter
px
Enter one or more pixel values.
Enter one or more rem values.

What is the px to rem converter?

Convert CSS pixel values to rem and rem values back to pixels as you type. The calculation uses the root font size you choose; 16 px is a common default, but a site's html font size or a visitor's browser settings can change it.

Enter a single size or a space- or comma-separated list. Results are calculated in your browser, can be copied, and update with the selected base font size. The common-sizes table also recalculates for that base.

rem is relative to the root html font size, so it can scale with browser text-size preferences. This makes rem useful for accessible and flexible typography and spacing.

How to use the px to rem converter

  1. 1Enter one or more pixel values in Pixels → rem, and/or rem values in Rem → pixels.
  2. 2Set Base font size to the computed root font size of your CSS; it starts at 16 px.
  3. 3Copy either result. The common values table updates when the base changes.

Features

Two-way conversion

Convert px to rem and rem to px at the same time.

Instant results

Updates as you type; calculations stay in your browser.

Multiple values

Convert whitespace- or comma-separated sizes in one go.

Custom root size

Use your site's root font size instead of the 16 px starting value.

Copyable results

Copy either converted value with one click.

Common-size reference

See a table of common pixel sizes converted to rem for your chosen base.

Frequently asked questions

What is the px to rem formula?

Divide the pixel value by the root font size: 24px ÷ 16 = 1.5rem.

How do I convert rem to px?

Multiply the rem value by the root font size: 1.5rem × 16 = 24px.

Is the root font size always 16 px?

No. 16 px is a common browser default, but CSS on the page or browser settings can change it. Enter the root size used by your site for an accurate result.

What is the difference between rem and em?

rem is relative to the root (html) font size; em is relative to the font size of the current element.

Why use rem instead of px?

rem-based sizes can scale with the root font size and browser text-size preferences, which can help people who need larger text.

What if my html font size is 62.5%?

If the browser's initial size is 16 px, 62.5% makes the root 10 px. Set Base font size to 10 px.

Are my values sent to a server?

No. This converter calculates values in your browser and does not send them to a Mota SEO endpoint.