Skip to content

PX to REM Converter — Convert Pixels to Rem

Convert px to rem instantly. 16px = 1rem at the default base, plus any custom root font-size. Free, live two-way conversion that runs 100% in your browser.

No Tracking Runs in Browser Free
px
Preview

The quick brown fox

Reviewed for CSS rem-unit accuracy and accessibility guidance — Go Tools Engineering Team · Jun 11, 2026

Quick Reference

What Is 16px in rem?

16px = 1rem (at 16px base) At the browser-default 16px root font-size, 16px equals exactly 1rem. This is the anchor for every other conversion: rem = px ÷ 16.

What Is the px to rem Formula?

rem = px ÷ root-font-size Divide the pixel value by the root font-size. For example, 24px ÷ 16 = 1.5rem. Change the base in the tool if your project does not use 16px.

What Is the 62.5% Trick?

62.5% → 1rem = 10px Setting html { font-size: 62.5% } makes the root 10px, so 1rem = 10px and rem math is just "divide by 10". Set this tool's base to 10 to use it.

What Is a PX to REM Converter?

A px to rem converter translates pixel measurements into rem units for CSS. The rem ("root em") unit is relative to the font-size of the root element: 1rem always equals the root font-size, which browsers set to 16px by default. The conversion is a simple division — rem = px ÷ root-font-size — but doing it by hand for every font size, margin, and breakpoint in a stylesheet is tedious and error-prone, which is what this tool removes.

The reason to convert at all is accessibility and scalability. When a value is written in px, it is locked to a fixed size and ignores the user's browser font-size preference. When it is written in rem, it scales proportionally if the user increases their default font size — a critical accommodation for people with low vision and a smoother experience for everyone who zooms. Expressing a design system in rem also means a single change to the root font-size rescales the entire interface consistently.

This converter keeps both the pixel and rem fields linked in real time, so you can move in either direction, and — unlike tools that hard-code a 16px base — it lets you set any root font-size. That matters because a stylesheet using the 62.5% technique (a 10px root) converts differently from a default 16px setup. A live preview shows the resulting text size, and a reference table lists the most common px values at a 16px base for quick lookups.

Need the reverse direction? Use the rem to px converter. For tidying up the stylesheet itself, try the CSS formatter, and for color work see the color converter. Everything runs in your browser — your values never leave your device.

/* The core formula */
/* rem = px ÷ root-font-size (16px by default) */

:root {
  font-size: 16px; /* 1rem = 16px */
}

.title  { font-size: 1.5rem;  } /* 24px */
.body   { font-size: 1rem;    } /* 16px */
.caption{ font-size: 0.75rem; } /* 12px */
.card   { padding: 1.5rem;    } /* 24px */

/* JavaScript equivalent */
const pxToRem = (px, base = 16) => px / base;
console.log(pxToRem(24)); // 1.5
console.log(pxToRem(12)); // 0.75

Key Features of This PX to REM Converter

Custom Root Font-Size

Convert against any base, not just 16px. Match the 62.5% (10px) technique or your project's actual root font-size — most tools hard-code 16.

Live Two-Way Conversion

Pixels and rem fields stay linked in real time. Edit either side and the other updates instantly against your chosen base.

Built-In Size Preview

A preview line renders text at the resulting rem size so you can see the scale, not just the number.

One-Click Copy

Copy the px or rem value to your clipboard with a single click, ready to paste straight into your CSS.

Reference Conversion Table

A chart of the most common px values and their rem equivalents at a 16px base for quick, no-typing lookups.

100% Browser-Based & Private

All math happens locally in your browser. No server requests, no tracking, no data storage — your values never leave your device.

PX to REM Conversion Examples

Body Text — 16px to rem

16
1rem

At the default 16px root font-size, 16px equals exactly 1rem. This is the baseline every other conversion is measured against: rem = px ÷ 16.

Heading — 24px to rem

24
1.5rem

A 24px heading becomes 1.5rem (24 ÷ 16 = 1.5). Using rem means the heading scales automatically if the user changes their browser's default font size.

Small Label — 12px to rem

12
0.75rem

12px is 0.75rem at a 16px base. Fine print and captions are common candidates for rem so they respect the reader's font-size preferences.

Spacing — 8px to rem

8
0.5rem

8px equals 0.5rem. Many design systems express padding and margins in rem so spacing scales together with text.

62.5% Trick — 10px base, 18px to rem

18
1.125rem

If you set the root font-size to 10px (the 62.5% technique), 18px becomes 1.8rem. At the default 16px base, 18px is 1.125rem. Always convert against the base your project actually uses.

Breakpoint — 768px to rem

768
48rem

A 768px media-query breakpoint is 48rem at a 16px base. Rem-based breakpoints zoom more predictably when users scale their text.

How to Convert Common px Values to rem

Quick reference for the px values developers convert to rem most often, at the default 16px root font-size.

How to Convert 16px to rem

16 px 1 rem

Divide 16 by the 16px root font-size to get 1rem. 16px is the anchor value — it equals exactly 1rem on a default setup, which is why it is the reference point for all other conversions.

16 px 1 rem

Memorize 16px = 1rem. From there, halve for 0.5rem (8px) and double for 2rem (32px).

Try it above — enter your pixel value and see the rem instantly.

How to Convert 24px to rem

24 px 1.5 rem

Divide 24 by 16 to get 1.5rem. 24px is a common heading and large-button size, so 1.5rem appears frequently in design systems.

24 px 1.5 rem

24px is exactly 1.5× the base, so it maps cleanly to 1.5rem — a tidy value for headings.

Try it above — enter your pixel value and see the rem instantly.

How to Convert 12px to rem

12 px 0.75 rem

Divide 12 by 16 to get 0.75rem. 12px is a common size for captions, labels, and fine print that should still respect user font-size preferences.

12 px 0.75 rem

12px = 0.75rem (three quarters of the base). Useful for secondary text.

Try it above — enter your pixel value and see the rem instantly.

How to Convert 14px to rem

14 px 0.875 rem

Divide 14 by 16 to get 0.875rem. 14px is a very common body and UI text size, so 0.875rem shows up constantly in component libraries.

14 px 0.875 rem

14px = 0.875rem. It is the default text size in many UI frameworks.

Try it above — enter your pixel value and see the rem instantly.

How to Convert 32px to rem

32 px 2 rem

Divide 32 by 16 to get 2rem. 32px is a frequent large-heading and section-spacing value, mapping to a clean 2rem.

32 px 2 rem

32px = 2rem, exactly double the base — easy to remember for big headings and generous spacing.

Try it above — enter your pixel value and see the rem instantly.

How to Convert 10px to rem

10 px 0.625 rem

Divide 10 by 16 to get 0.625rem at the default base. Note that 10px is also the root font-size used by the 62.5% technique, where 10px would instead equal 1rem.

10 px 0.625 rem

At a 16px base, 10px = 0.625rem. If you adopt the 62.5% technique, set the base to 10 and 10px becomes 1rem.

Try it above — enter your pixel value and see the rem instantly.

PX to REM Conversion Chart

Pre-calculated px to rem values at the default 16px root font-size. Bookmark this page for quick lookups.

Pixels to Rem (16px base)

Pixels to rem conversion table at a 16px root font-size
PX REM
8 0.5
9 0.5625
10 0.625
11 0.6875
12 0.75
13 0.8125
14 0.875
15 0.9375
16 1
17 1.0625
18 1.125
19 1.1875
20 1.25
21 1.3125
22 1.375
23 1.4375
24 1.5
28 1.75
32 2
36 2.25
40 2.5
44 2.75
48 3

Common Sizes to Rem

Larger pixel values to rem at a 16px root font-size
PX REM
56 3.5
64 4
72 4.5
80 5
88 5.5
96 6

How to Use the PX to REM Converter

  1. 1

    Enter a Pixel Value

    Type or paste a number into the Pixels (px) field. The equivalent rem appears instantly — no convert button needed.

  2. 2

    Set the Root Font-Size (optional)

    The base defaults to 16px. Change it to match your project — for example 10px for the 62.5% technique — and every result updates against the new base.

  3. 3

    Read the Rem Result and Preview

    The Rem field shows the converted value, the preview line renders text at that size, and the formula confirms the current ratio (e.g. 1rem = 16px).

  4. 4

    Copy the Value

    Click the copy icon next to either field to copy the px or rem value to your clipboard, ready to paste into your CSS.

Use Cases for PX to REM Conversion

Building Responsive, Accessible UIs
Convert pixel-based font sizes and spacing to rem so the interface scales with the user's browser font-size preference.
Translating Design Mockups
Turn a designer's px values from Figma or Sketch into rem units that fit a scalable CSS design system.
Setting Media-Query Breakpoints
Express breakpoints in rem so layouts respond predictably when users zoom or change their default text size.
Adopting the 62.5% Technique
Convert against a 10px root font-size to get clean rem arithmetic when using html { font-size: 62.5% }.
Refactoring Legacy CSS
Systematically replace fixed px values with rem to modernize an older stylesheet for accessibility.
Verifying Computed Sizes
Quickly check what a px value resolves to in rem (or back again) while debugging spacing and typography.

Technical Details

The rem Unit
rem is relative to the root font-size. 1rem equals that font-size in pixels — 16px by default — so rem = px ÷ root-font-size.
Double-Precision Arithmetic
Conversions use IEEE 754 double-precision floating point, rounded to at most five decimals with trailing zeros trimmed for clean CSS values.
Client-Side Processing
All conversion logic runs in JavaScript within your browser. Zero network calls are made — the tool works fully offline once loaded.

Best Practices for Using rem

Convert Against Your Real Base
Always use the root font-size your stylesheet actually sets. A 10px base (62.5% technique) converts differently from the 16px default.
Use rem for Type and Spacing, px for Hairlines
Size fonts, padding, and margins in rem so they scale with user preferences; keep px for things that must stay fixed, like 1px borders.
Keep Breakpoints in rem or em
Rem-based media queries zoom more gracefully than px breakpoints when users scale their text.

PX to REM FAQ

What is 16px in rem?
16px equals exactly 1rem when the root font-size is the browser default of 16px. The rem unit is relative to the font-size of the root element, so rem = px ÷ root-font-size. Because most browsers default to 16px, 16px is the natural anchor: 16px = 1rem, 8px = 0.5rem, 32px = 2rem. If you change the root font-size, the ratio changes accordingly.
How do you convert px to rem?
To convert px to rem, divide the pixel value by the root font-size (16px by default). The formula is rem = px ÷ base. For example, 24px ÷ 16 = 1.5rem, and 12px ÷ 16 = 0.75rem. This tool does the division for you in real time and lets you change the base if your project uses a different root font-size.
What is 1rem in pixels?
1rem equals the root font-size in pixels — 16px by default. So 1rem = 16px, 1.5rem = 24px, and 2rem = 32px on a standard setup. If you set html { font-size: 62.5% } (10px), then 1rem = 10px instead. To go from rem back to pixels, multiply: px = rem × base.
Why use rem instead of px?
Rem units respect the user's browser font-size preference, which is essential for accessibility. When someone increases their default font size — for low vision or simply comfort — everything sized in rem scales proportionally, while px values stay fixed and can break layouts or ignore the preference. Rem also keeps a design system consistent: change one root font-size and the whole interface scales together. Pixels are still useful for things that should not scale, such as 1px borders.
What is the difference between px, rem, and em?
px is an absolute unit — one CSS pixel, fixed regardless of context. rem is relative to the root () font-size, so it is consistent everywhere on the page. em is relative to the font-size of the current element's parent, so it compounds when nested. Use px for fixed details like hairline borders, rem for most sizing so it scales with the user's preference, and em when you want a value to scale relative to its local context (for example padding that grows with a button's own font size).
What is the 62.5% font-size trick?
Setting html { font-size: 62.5% } makes the root font-size 10px (because 62.5% of the 16px default is 10px). With a 10px base, rem math becomes trivial: 1rem = 10px, 1.6rem = 16px, 2.4rem = 24px — just divide the pixel value by 10. Many developers like the simpler arithmetic, though you then typically set body { font-size: 1.6rem } to restore readable 16px body text. Set this tool's root font-size to 10 to convert against the 62.5% base.
Can I change the root font-size in this converter?
Yes. The Root font-size field defaults to 16px (the browser default) but you can type any value — 10, 18, 20, or whatever your project uses. Every conversion and the reference table update against the base you set. Click 'Reset to 16' to return to the default. Most tools hard-code 16px; the custom base is what lets this converter match your real stylesheet.
Is 16px always equal to 1rem?
Only when the root font-size is 16px, which is the default in virtually all browsers. The relationship 16px = 1rem holds as long as you do not override html { font-size }. If a stylesheet sets the root font-size to something else — say 10px or 18px — then 16px no longer equals 1rem. Always convert against the actual root font-size of the page.
Should I convert font sizes, padding, and margins to rem?
Font sizes are the strongest candidates for rem because they directly affect readability and accessibility. Padding, margin, gap, and border-radius are also commonly expressed in rem so spacing scales together with text for a cohesive layout. Media-query breakpoints in rem (or em) zoom more gracefully. Keep px for things that must not scale, like 1px borders and some box-shadow offsets.
Does converting px to rem change how my site looks?
No — at the default 16px root font-size, a value in rem renders at exactly the same pixel size as the original px value. 24px and 1.5rem look identical on a standard setup. The difference is behavioral: the rem version will scale if the user changes their browser font size, whereas the px version will not. Visually nothing changes until the user adjusts their preferences.
How accurate is this px to rem converter?
Conversions use IEEE 754 double-precision arithmetic and the exact formula rem = px ÷ base, with results rounded to at most five decimal places and trailing zeros trimmed for readability. For CSS that precision is far finer than the browser needs. The math is deterministic and runs the same every time, so you can rely on it for production stylesheets.
Is my data safe when using this converter?
Completely. All conversions run locally in your browser using JavaScript. No values are sent to any server — there are no network requests, no cookies on your input, and no analytics tied to what you type. You can verify this by disconnecting from the internet: the tool keeps working fully offline once the page has loaded.

Related Tools

View all tools →