PX to REM Converter

Convert pixels to rem and back, plus em, pt, pc, inches, cm, mm, percent, vw and vh, using your own root font size, parent size and viewport.

Design & CSS Runs in your browser · no upload

Reviewed 23 November 2026 · Free · No account needed

ExecutionYour browserInput never leaves your tab
File retentionNoneNothing is stored
AccountNot requiredNo sign-up, no paywall
PriceFreeNo trial, no usage cap on the tool itself

How to use

  1. Type a value and choose the unit you are converting from, such as px.
  2. Set the root font size (16 px by default) so rem matches your stylesheet.
  3. Set the parent font size and viewport size if you also need em, percent, vw or vh.
  4. Read every unit at once and click the copy button on the one you need, for example 1.5rem.

Example

Input: 24 px with a 16 px root

Output: 1.5rem · 1.5em · 18pt · 0.25in · 6.35mm

How it works

Every unit is converted through pixels. The value is multiplied by how many pixels one unit equals, then divided by how many pixels the target unit equals.

px = value × pixels per unit. Pixels per unit: rem = root font size, em = parent font size, % = parent font size ÷ 100, pt = 96 ÷ 72, pc = 16, in = 96, cm = 96 ÷ 2.54, mm = 96 ÷ 25.4, vw = viewport width ÷ 100, vh = viewport height ÷ 100.

Another example

24 px with a 16 px root: 24 ÷ 16 = 1.5 rem. In points, 24 × 72 ÷ 96 = 18 pt.

Limits and edge cases

  • rem uses the root font size you enter. If a site changes it, enter that value instead of 16.
  • em depends on the parent element, and for properties other than font-size it is based on the element's own font size, so set the parent size to match where you use it.
  • vw and vh depend on the viewport width and height you enter. On phones the visible height changes as the browser bars show and hide.
  • Physical units such as cm and inches follow the CSS reference of 96 pixels per inch, not the real size on your screen.
  • The root and parent sizes must be greater than zero, or the converter asks you to fix them.
  • Results are rounded to four decimals and trailing zeros are dropped, so 1.5000 shows as 1.5.
  • Negative values are allowed, for example for margins.
  • With a 62.5% root setting (10 px on a default browser), enter 10 as the root to match.

Privacy

All conversions are calculated in your browser. Nothing you enter is sent to a server or stored.

About this page

Written and reviewed by Toolnexo on 23 November 2026. The limits above describe the published tool, not an idealised version of it. If a result looks wrong or the page is unclear, email [email protected] with the tool URL and what you entered. Corrections are published here.

Further reading

Guides that use PX to REM Converter

All guides →

Related tools

FAQ

Questions about PX to REM Converter

How do I convert px to rem?

Divide the pixel value by the root font size. With the browser default of 16 px, 24 px is 24 ÷ 16 = 1.5rem. If your site sets a different root size, enter it in the root font size box and the converter does the division for you.

What is the difference between rem and em?

rem is relative to the root (html) font size, so it is the same everywhere on the page. em is relative to the parent element's font size for font-size and to the element's own font size for other properties, so nested elements can compound. rem is usually easier to reason about for spacing and type scales.

Why use rem instead of px for font sizes?

Rem sizes follow the font size people set in their browser, so text and layouts scale for readers who need larger type. Pixel sizes ignore that setting. Browser zoom works with both.

What base size should I use?

Browsers default to 16 px, and most designs assume it. Some teams set the root to 62.5% so that 1rem equals 10 px for easy maths. That works, but remember to set body text back to a readable size such as 1.6rem.

How many pixels are in a point, pica or inch?

CSS defines 1 inch as 96 px, 1 point as 1/72 inch (about 1.333 px), 1 pica as 16 px, 1 cm as about 37.8 px and 1 mm as about 3.78 px. These are reference values for the screen, not physical lengths.