PX to REM chart
Every pixel size from 1px to 64px, plus 72, 80, 96 and 128px, converted to rem at a 16px root font size, the usual browser default. Change the root font size above and the chart recalculates.
| Pixels | REM (16px base) | Percent of root |
|---|---|---|
| 1px | 0.0625rem | 6.25% |
| 2px | 0.125rem | 12.5% |
| 3px | 0.1875rem | 18.75% |
| 4px | 0.25rem | 25% |
| 5px | 0.3125rem | 31.25% |
| 6px | 0.375rem | 37.5% |
| 7px | 0.4375rem | 43.75% |
| 8px | 0.5rem | 50% |
| 9px | 0.5625rem | 56.25% |
| 10px | 0.625rem | 62.5% |
| 11px | 0.6875rem | 68.75% |
| 12px | 0.75rem | 75% |
| 13px | 0.8125rem | 81.25% |
| 14px | 0.875rem | 87.5% |
| 15px | 0.9375rem | 93.75% |
| 16px | 1rem | 100% |
| 17px | 1.0625rem | 106.25% |
| 18px | 1.125rem | 112.5% |
| 19px | 1.1875rem | 118.75% |
| 20px | 1.25rem | 125% |
| 21px | 1.3125rem | 131.25% |
| 22px | 1.375rem | 137.5% |
| 23px | 1.4375rem | 143.75% |
| 24px | 1.5rem | 150% |
| 25px | 1.5625rem | 156.25% |
| 26px | 1.625rem | 162.5% |
| 27px | 1.6875rem | 168.75% |
| 28px | 1.75rem | 175% |
| 29px | 1.8125rem | 181.25% |
| 30px | 1.875rem | 187.5% |
| 31px | 1.9375rem | 193.75% |
| 32px | 2rem | 200% |
| 33px | 2.0625rem | 206.25% |
| 34px | 2.125rem | 212.5% |
| 35px | 2.1875rem | 218.75% |
| 36px | 2.25rem | 225% |
| 37px | 2.3125rem | 231.25% |
| 38px | 2.375rem | 237.5% |
| 39px | 2.4375rem | 243.75% |
| 40px | 2.5rem | 250% |
| 41px | 2.5625rem | 256.25% |
| 42px | 2.625rem | 262.5% |
| 43px | 2.6875rem | 268.75% |
| 44px | 2.75rem | 275% |
| 45px | 2.8125rem | 281.25% |
| 46px | 2.875rem | 287.5% |
| 47px | 2.9375rem | 293.75% |
| 48px | 3rem | 300% |
| 49px | 3.0625rem | 306.25% |
| 50px | 3.125rem | 312.5% |
| 51px | 3.1875rem | 318.75% |
| 52px | 3.25rem | 325% |
| 53px | 3.3125rem | 331.25% |
| 54px | 3.375rem | 337.5% |
| 55px | 3.4375rem | 343.75% |
| 56px | 3.5rem | 350% |
| 57px | 3.5625rem | 356.25% |
| 58px | 3.625rem | 362.5% |
| 59px | 3.6875rem | 368.75% |
| 60px | 3.75rem | 375% |
| 61px | 3.8125rem | 381.25% |
| 62px | 3.875rem | 387.5% |
| 63px | 3.9375rem | 393.75% |
| 64px | 4rem | 400% |
| 72px | 4.5rem | 450% |
| 80px | 5rem | 500% |
| 96px | 6rem | 600% |
| 128px | 8rem | 800% |
Source: thealltools.com/tools/px-to-rem
About this tool
This converter turns pixel values into rem units and back, using whatever root font size you give it. It starts at 16px because that is the common browser default, so 1rem usually equals 16px and 24px becomes 1.5rem. Below the converter is a printable px to rem chart covering 1px to 64px and a few larger heading sizes. Everything runs in your browser.
How to use the PX to REM converter
- Set the root font size. Leave it at 16 unless your stylesheet sets a different size on the
htmlelement (for example 62.5%, which gives 10px with the usual default). - Type in either field. Enter pixels to get rem, or enter rem to get pixels. The other field updates as you type.
- Check the em note if you need
eminstead. Set the font size the em will resolve against and the tool shows the em value. - Copy the CSS snippet, or scroll to the chart, which recalculates for your root size and can be printed.
The formula
The CSS Values and Units specification defines rem as equal to the computed value of em on the root element, which in practice means the font size of the html element. So the conversion is a single division:
rem = px ÷ root font size px = rem × root font size
MDN describes 16px as a common browser default that user preferences may change. It is not a fixed constant, which is why the base is editable here.
Worked example
With the default inputs, a root font size of 16 and 24 pixels, the tool computes 24 ÷ 16 = 1.5rem and writes this snippet:
html { font-size: 100%; } /* = 16px when the browser default is 16px */
.example { font-size: 1.5rem; } /* = 24px */
Change the root to 18 and the same 24px becomes 1.3333rem (24 ÷ 18, rounded to four decimals), and the snippet sets the root to 112.5%. With a root of 10, 24px is 2.4rem. The em note reads 1.5em because the em context also starts at 16px.
Why rem helps accessibility
Many people raise their browser's default font size to make text easier to read. MDN notes that absolute lengths such as px do not scale with that setting, and recommends relative units such as em or rem for font-size. When your type is sized in rem, a reader who sets their default to 20px gets text that is 25% larger everywhere, with the proportions intact.
This ties into WCAG Success Criterion 1.4.4 Resize Text (Level AA), which asks that text can be resized without assistive technology up to 200 percent without loss of content or functionality. Using rem does not satisfy that criterion on its own. Containers also have to grow with the text instead of clipping it, but rem makes the text side of it straightforward.
rem vs em
Both are font-relative, but they measure from different places. rem always refers to the root font size, so 1.5rem is the same size anywhere on the page. em refers to the element's own font size, and when it is used on font-size itself, to the inherited (parent) size. That makes em compound: a list item set to 1.2em inside another 1.2em item ends up 1.44 times the base. Use rem for a predictable type scale, and em when something should scale with its own component, such as padding on a button that should grow with the button's text.
The 62.5% trick and its tradeoffs
Some stylesheets set html { font-size: 62.5%; }. With a 16px default that makes the root 10px, so 1.4rem is 14px and the mental math becomes easy. Because it is a percentage, it still respects the reader's setting: with a 20px default, the root becomes 12.5px. The tradeoffs:
- You have to set a readable size back on
body(such as1.6rem), or any text without its own size renders at 10px. - Third-party components and libraries that assume 1rem is about 16px will render smaller than intended.
- "1rem = 10px" only holds for readers on the 16px default, so it is a convenience for authors rather than a guarantee.
- Never set the root in pixels (
html { font-size: 10px; }). That overrides the reader's preference, which removes the accessibility benefit of rem.
rem in media queries
Media query breakpoints written in rem or em do not use your html font size. The Media Queries Level 4 specification states that relative length units in media queries are based on the initial value. In practice, @media (min-width: 40rem) is measured against the browser's default font size even if your stylesheet sets the root to 62.5%. Convert breakpoints with the browser default, usually 16px, not your custom root.
Common mistakes
- Converting with 10 when the root is 62.5% but writing breakpoints with the same math. Breakpoints still use the browser default.
- Using em where rem was intended, then wondering why nested text keeps growing.
- Rounding too hard. 13px at a 16px base is
0.8125rem, and rounding it to 0.8rem gives 12.8px. - Converting borders to rem without thinking. A 1px hairline is often meant to stay 1px.
Use cases
- Turning a design file's pixel type scale into rem values for a stylesheet or design tokens.
- Checking what a rem value in someone else's CSS works out to in pixels.
- Building a spacing scale (4, 8, 12, 16, 24, 32px) that scales with the reader's font setting.
After converting, you can tidy your stylesheet with the CSS Minifier, convert colors with the Color Converter, and check text legibility with the Contrast Checker.
Frequently asked questions
1rem equals the font size of the root html element. With the usual browser default and no root size set in your CSS, that is 16px. If your stylesheet sets the root to 62.5%, 1rem is 10px for readers on the default, and it changes again for anyone who has picked a larger default font size.
Divide the pixel value by the root size. At 16px, halving four times works: 8px is 0.5rem, 4px is 0.25rem, 2px is 0.125rem. Multiples of 16 are whole numbers, so 32px is 2rem and 48px is 3rem. For awkward values like 13px or 15px, use the chart or the converter to get the exact decimal.
It is common, because spacing then grows with the text when a reader raises their default font size, which keeps layouts balanced. Some teams keep small details like 1px borders and outlines in pixels so they stay crisp. Whatever you choose, apply it consistently so components scale together.
Page zoom scales everything, including pixel values, so px and rem look the same when zooming. The difference shows up with the default font size setting in the browser preferences. Text sized in rem or percentages follows that setting, while text sized in px stays fixed.
Yes. Many frameworks, Tailwind among them, define their default spacing and type scales in rem with 1rem treated as 16px. If you change the root font size, every rem-based utility changes with it, so check the framework documentation before setting a custom root size.
rem is tied to the root font size. rlh is tied to the root line height, so it is useful for vertical rhythm. vw is one percent of the viewport width and ignores font settings entirely, which is why text sized only in vw can fail to scale when a reader asks for larger text.