PX to REM Converter

Free PX to REM converter with a custom root font size. Convert px, rem, em, pt, %, vw and vh both ways, see a full table, and convert whole stylesheets.

Type a value in any CSS unit and see it in px, rem, em, pt, percent, vw, vh, inches, centimetres and millimetres at once. REM is calculated as pixels divided by the root (html) font size, 16px by default in every browser; em uses the parent element's font size, and vw/vh use the viewport size you set. A reference table lists common sizes, and the bulk converter rewrites every px value in pasted CSS as rem.

Runs entirely in your browser and works offline. Nothing you enter or upload leaves your device. Free, no sign-up.

Features

How to use PX to REM Converter

  1. Set the root font size (16px unless your html element changes it).
  2. Enter a value and pick its unit — every other unit updates instantly.
  3. Click any result to copy it, or use the table for common sizes.
  4. To convert a stylesheet, paste CSS into the bulk converter and copy the rem version.

Frequently asked questions

How do I convert px to rem?

Divide the pixel value by the root font size. With the default 16px root, 24px ÷ 16 = 1.5rem and 14px ÷ 16 = 0.875rem. To go back, multiply: 2rem × 16 = 32px.

What is the difference between rem and em?

rem is relative to the root html element's font size, so 1rem is the same everywhere on the page. em is relative to the font size of the element's parent (or the element itself for properties other than font-size), so nested ems compound. rem is usually easier to reason about for spacing and type scales.

Why use rem instead of px?

When a user raises the default font size in their browser settings, sizes in rem scale with it while sizes in px stay fixed. Using rem for font sizes and most spacing makes a site more accessible and keeps proportions consistent.

How many pixels is a point (pt)?

CSS defines 1in = 96px = 72pt, so 1pt = 1.333px and 1px = 0.75pt. A 12pt font is 16px. These are CSS reference units; physical size on screen depends on the device.

What does setting html { font-size: 62.5% } do?

It makes the root font size 10px (62.5% of 16px), so 1rem = 10px and conversions become simple: 1.4rem = 14px. Set the root size here to 10 to match. Remember to set a readable font size back on the body.

Related tools

All free tools · This tool as Markdown