Skip to main content
GARGLOO

PX to REM Converter Online – Free, Instant & Local

Every unit at once, at your root size.

Runs on your device

At a glance

Input:
A number and a root size — nothing uploaded
Processing:
Runs entirely in your browser — the arithmetic, the table and the bulk CSS pass never leave the tab.
Privacy:
Nothing is stored or sent. Pasted CSS disappears when you leave the page.

Last updated: 2026-11-13

Common use cases

  • Sizing a heading in rem: 32 px at the 16 px root is 2 rem — type it once and copy the value.
  • Migrating a stylesheet: paste the whole file in Bulk CSS and get rem everywhere except 1px borders and media queries.
  • Checking the 62.5% trick: flip the root to 10 px and read the table — 24 px becomes 2.4 rem.
  • Sizing a fluid hero: read the vw column to see what 192 px is on a 1920 px viewport (10vw).

About this tool

A px to rem converter that shows every unit at once — rem, em, pt, %, vw and vh — at any root font size you set, with a px→rem reference table (8–96 px) and a bulk CSS tab that rewrites a whole stylesheet to rem. The arithmetic is one division: rem = px ÷ root. At the browser default of 16 px, 24 px is 1.5 rem, 32 px is 2 rem and 16 px is 1 rem = 12 pt; flip the root to 10 px (the 62.5% trick) and 24 px becomes 2.4 rem. The honest distinctions are on the page: 1 rem = the root (html) font size — 16 px by default, but only if the page does not set its own root size; em is relative to the PARENT font size, not the root — do not mix them up; and rem follows the reader's font-size setting while px does not, which is the accessibility reason to use rem for text (WCAG 1.4.4: text resizable to 200%). The bulk tab converts every px value and deliberately leaves 1px borders, border/outline widths, media-query conditions, comments, url(...) and quoted strings untouched; 0px becomes unitless 0. Everything runs locally — nothing you type or paste leaves the tab.

How to use it

  1. Type a value and pick its unit — px, rem, em, pt, % or vw/vh.
  2. Set the root font size (16 px is the browser default; 10 px is the 62.5% trick) and the viewport size for vw/vh.
  3. Copy any single unit, or copy all seven at once.
  4. For a whole stylesheet, use the Bulk CSS tab: paste, read the converted CSS, and download it as a .css file.

Worked examples

Input: 24 px at the 16 px root

Output: 1.5 rem · 1.5 em · 18 pt · 150%

The headline example: 24 ÷ 16 = 1.5. At the 10 px root the same 24 px is 2.4 rem.

Input: 16 px at the 16 px root

Output: 1 rem · 12 pt · 100%

1 pt = 4/3 px, so 16 px = 12 pt — the absolute-unit factor from W3C CSS Values and Units Level 4 §6.2.

Input: Bulk: .card { margin: 16px; border: 1px solid #000; }

Output: .card { margin: 1rem; border: 1px solid #000; }

The margin converts; the 1px border is deliberately left alone.

Practical tips

  • Set the root to your project's real html font-size before copying values — a rem number is meaningless without its root.
  • Use the table tab for the common sizes (8–96 px) instead of converting one by one.
  • In bulk mode, check the 'kept' count — a 1px border that stayed px is a feature, not a miss.
  • Pair vw with a max-width in px or rem: pure vw text keeps growing on ultrawide screens.

Common mistakes

  • Assuming 1 rem is always 16 px — a page that sets html { font-size: 10px } makes 1 rem = 10 px.
  • Using em for component spacing in nested components — em compounds with each parent; rem does not.
  • Converting media-query breakpoints to rem — a breakpoint is a device width, and this tool leaves it in px on purpose.
  • Converting 1px borders to 0.0625rem — sub-pixel borders render inconsistently; keep them 1px.

How this compares

Most px-to-rem sites in the field show one value and one table. This one shows all seven units at once, a table that follows your root size, and a bulk CSS pass that leaves 1px borders and media queries alone — locally, with no signup. The tradeoff: it converts lengths only — it does not lint your CSS or rewrite clamp() expressions, and vw/vh need your viewport size to be right.

Good to know

  • em equals rem here only when the parent font size equals the root size — nested em values compound and this page cannot know your DOM.
  • vw/vh use the viewport size you type (1920×1080 by default) — if your real viewport differs, those two columns differ too.
  • The bulk pass converts the px inside calc() but cannot simplify the expression around it.
  • 1 pt = 4/3 px is exact by the CSS spec (1 px = 1/96 in, 1 pt = 1/72 in) — but a printer's point and a CSS point are only the same by that definition.
  • Values round to 4 decimals — 1/3 rem shows as 0.3333 rem, a 0.000033 rem rounding difference the eye cannot see.

Frequently asked questions

How do I convert px to rem?

Divide by the root font size: rem = px ÷ root. At the browser default of 16 px, 24 px ÷ 16 = 1.5 rem. Change the root size above and every value updates — the 62.5% trick sets the root to 10 px, so 24 px becomes 2.4 rem.

What is the difference between rem and em?

rem is relative to the ROOT (html) font size; em is relative to the PARENT font size. If a parent sets font-size: 20px, 1em inside it is 20 px, while 1rem is still the root size. This tool shows em equal to rem only when the parent sits at the root size — do not mix them up in nested components.

Why use rem instead of px for text?

rem follows the reader's font-size setting; px does not. A reader who enlarges their default font size gets larger rem text, which is the point of WCAG 1.4.4 (text resizable to 200%). Use rem for text and spacing, px for hairline borders.

What does the bulk CSS converter leave alone?

1px values (the classic 1px border), all border and outline widths, px inside @media conditions (a breakpoint is a device width, not a font size), and px inside comments, url(...) and quoted strings. 0px becomes unitless 0. Everything else becomes rem at your root size.

Is my CSS sent anywhere?

No. Conversion, the table and the bulk pass all run in your browser — paste proprietary stylesheets freely, nothing leaves the tab.

All developer tools
PX to REM Converter Online – Free, Instant & Local | GARGLOO