PX to REM Converter

Convert pixels to rem, em and percent for any base font size — 16px by default, the browser standard — with a two-way converter and a full table of the sizes designers use every day.

1Set your base font size
2Type pixels (or rem) to convert
3Read rem, em and percent — or use the table
1.5remrem
1.5emem (against base)
150%percent of base

Conversion table

PixelsREMPercent of base

The table follows the base size you set above — change the base and every row recalculates.

Private by design: 100% in your browser — nothing is uploaded, no sign-up. This tool runs entirely on your device.

How to use this PX to REM converter

Leave the base at 16 — the default root font size in every major browser — unless your project deliberately sets a different one, and type a pixel value. The converter shows the same measurement three ways: in rem, in em measured against the base, and as a percentage of the base. It also works backwards: type a rem value and the pixel field fills in, which is the direction you need when reviewing someone else's stylesheet. The quick chips cover the sizes that dominate real designs, and the table underneath lists the full working range, recalculated live whenever you change the base.

The whole conversion is one division — pixels ÷ base — but it is a division people mistype surprisingly often, usually by using the wrong base. Keeping the base visible, editable and applied consistently to every number on the page is the actual service this tool provides.

Example: 24 pixels, three ways

On the standard 16px base, 24px converts to 1.5rem (24 ÷ 16), shows as 1.5em against the same base, and equals 150% of the base size. The reverse journey is just as clean: 2rem × 16 = 32px. Change the base to 10 — as projects using the 62.5% root trick do — and the same 24px becomes 2.4rem, while 16px becomes 1.6rem. Nothing about the design changed; only the ruler did, which is exactly why stating your base matters whenever you share a conversion.

REM, EM and percent, without the fog

All three units on this page are relatives of the same idea: sizes expressed against something else instead of against the screen. A rem is relative to the root element's font size only, so it is stable and predictable down the whole document — the unit modern layouts are built on. An em is relative to the current element's parent, so nested ems multiply; that compounding is a feature for component-internal proportions and a trap everywhere else. A percentage font size works like em in fraction form. When the reference point is the root — the case this converter tabulates — all three describe the same size, and the table shows them side by side so you can pick the dialect your codebase speaks.

Why bother converting at all?

Because of the reader who sets their browser font to 20px. For that reader, a rem-based layout politely grows — text, spacing and containers in proportion — while a pixel-fixed layout stays stubbornly small, or breaks when only the text grows. Respecting that preference is a core accessibility behaviour, and it costs nothing but a unit change. The pragmatic pattern most teams settle on: font sizes and spacing in rem, media-query breakpoints in em or rem so layouts respond to text scaling too, and hairline borders left at 1px because a border's job is to be exactly one sharp line. Convert the typography, keep the hairlines — and let this page do the arithmetic.

A spacing scale you can convert once and reuse

Most interfaces do not need forty different sizes; they need about eight, used consistently. A common scale on the 16px base runs 4, 8, 12, 16, 24, 32, 48 and 64 pixels — in rem, 0.25, 0.5, 0.75, 1, 1.5, 2, 3 and 4. Converted once, those become the only numbers a stylesheet reaches for: gaps, padding and margins all snap to the scale, and the interface gains the quiet regularity that makes one screen feel designed and another feel assembled. The table above is built for exactly this job — set your base, read off your scale, and write the values into your CSS variables. If your design file uses different steps, the converter handles them one by one just as happily; the scale is a discipline, not a rule, and its real benefit is that a year from now you will still know why every number in the file is the number it is.

Frequently asked questions

How do you convert pixels to rem?

Divide the pixel value by the base font size — the font size set on the root (html) element. With the browser default base of 16px, 24px ÷ 16 = 1.5rem. This converter does the division for any base you set, and also shows the same value as em and as a percentage of the base.

What base font size should I use?

16 unless your project changes it. 16px is the default root font size in every major browser, so it is the base behind most published conversion tables. If your stylesheet sets html { font-size: 62.5% } — a popular trick that makes the base 10px — set the base here to 10 and the converter will match your project.

What is the difference between rem and em?

Both are relative units, but they refer to different things. A rem is always relative to the root element's font size, so 1.5rem means the same everywhere in the document. An em is relative to the font size of the element's parent, so ems compound as elements nest — powerful for component-internal spacing, surprising when you forget. For a flat conversion against the root size, the numbers coincide, which is why this page shows both.

Why use rem instead of pixels at all?

Accessibility. Users can raise their browser's default font size, and layouts built in rem scale with that choice — text, padding and spacing all grow together. Layouts fixed in pixels ignore the preference. Converting a design's pixel values to rem is the mechanical part of respecting it, which is what this tool is for.

How do I convert rem back to pixels?

Multiply by the base: 2rem × 16 = 32px. Type into the REM field of this converter and the pixel field fills in — it works in both directions, which is handy when a design tool gives you pixels and a codebase review asks what a rem value means on screen.

What does the percent value mean?

The pixel value expressed as a percentage of the base: 24px on a 16px base is 150%. Percentages appear when the base itself is set in percent — the famous 62.5% trick is 10px expressed against the 16px default — and in fluid-typography formulas, so the converter shows the figure alongside rem and em.

Should everything be converted to rem?

No. Font sizes and the spacing tied to them are the natural rem territory. Hairline borders (1px), outlines and some shadows are usually kept in pixels, because you want them to stay exactly one device-sharp line regardless of text scaling. Convert the typography system; leave the hairlines alone.

Why do I get long decimals like 0.8125rem?

Because 13 ÷ 16 is 0.8125 — most pixel values do not divide by 16 neatly. Browsers handle four-decimal rem values without complaint, and this converter rounds at four decimals. If a long tail bothers you, it is often a sign the design's spacing scale could be rounded to friendlier numbers.

Does the converter work for a 10px base?

Yes — change the base field to 10 and every result and the whole table recalculate: 24px becomes 2.4rem, 16px becomes 1.6rem. Any positive base works, including decimal ones, so the tool matches whatever root font size your project actually uses.

Related tools