PX to REM Converter
Guide: px vs rem vs em: Which CSS Unit Should You Use?
- rem
1.5rem- em
1.5em- pt
18pt- %
150%
Common sizes (base 16px)
| px | rem / em | pt |
|---|---|---|
| 8px | 0.5rem | 6pt |
| 10px | 0.625rem | 7.5pt |
| 12px | 0.75rem | 9pt |
| 14px | 0.875rem | 10.5pt |
| 16px | 1rem | 12pt |
| 18px | 1.125rem | 13.5pt |
| 20px | 1.25rem | 15pt |
| 24px | 1.5rem | 18pt |
| 28px | 1.75rem | 21pt |
| 32px | 2rem | 24pt |
| 36px | 2.25rem | 27pt |
| 40px | 2.5rem | 30pt |
| 48px | 3rem | 36pt |
| 56px | 3.5rem | 42pt |
| 64px | 4rem | 48pt |
| 72px | 4.5rem | 54pt |
| 96px | 6rem | 72pt |
Nothing you enter or choose here leaves your device. This tool runs in your browser.
The one calculation
Browsers set the root font size to 16 pixels by default. A rem is a multiple of that root size, so you convert by dividing. 24 pixels is 24 divided by 16, which is 1.5rem. Set a different base in the tool if your project changes the root size, and every result adjusts.
| Pixels | rem (base 16) | Common use |
|---|---|---|
| 12px | 0.75rem | Fine print, captions |
| 14px | 0.875rem | Small text, labels |
| 16px | 1rem | Body text |
| 18px | 1.125rem | Larger body text |
| 20px | 1.25rem | Lead paragraphs |
| 24px | 1.5rem | Subheadings |
| 32px | 2rem | Headings |
| 48px | 3rem | Large headings |
Why rem beats px for text
Many people raise their browser's default text size because they find the standard size too small. Sizes set in rem grow with that choice. Sizes set in pixels ignore it. For anything involving text, rem respects the person reading, which is both an accessibility win and an easy one to get.
rem versus em
A rem is based on the root. An em is based on the font size of the element's parent, so it compounds as you nest. If a list sits inside a list and each has a font size of 1.2em, the inner text is 1.44 times the base, and a third level is 1.73. This surprises people. Use rem for most sizes and keep em for things that should scale with their own text, such as padding on a button.
Points and percentages
- pt: a point is 1/72 of an inch, which works out to 1.333 pixels on a standard screen. Twelve points is 16 pixels. Points belong in print stylesheets.
- %: a percentage of the base size, so 150 percent of 16 pixels is 24 pixels.
A tip: the 62.5 percent trick
Some developers set the root font size to 62.5 percent, which makes 1rem equal 10 pixels, so 1.6rem is 16 pixels and the math is easy. It works, but it overrides the user's choice at the root, and you'll need to restore body text to 1.6rem. A calculator like this one makes the trick unnecessary.
Where pixels are still fine
Borders, thin lines, shadows and small fixed details like a 1px divider don't need to scale with text. Layout widths are often better in percentages or other relative units. Media queries are best in em, because browsers treat them in a way that respects zoom.
Use the CSS generator to build the rules and the CSS minifier for the finished stylesheet. For colors, see the color converter, and the guide to px, rem and em goes through the same ideas with more examples.
Written by Akinrinmade Michael · Updated October 24, 2026
How to use
- 1Type the value you want to convert.
- 2Choose the unit you are converting from.
- 3Set the base font size if yours isn't 16px.
- 4Read the other units and click Copy.
Frequently asked questions
How do I convert px to rem?
Divide the pixels by the root font size. With the browser default of 16px, 24px is 24 / 16 = 1.5rem.
What is the difference between rem and em?
rem is relative to the root element's font size, and em is relative to the font size of the current element's parent. With the same base they give the same number here.
Why use rem instead of px?
rem sizes scale when people change their browser's default font size, which helps accessibility.
How are pt and % calculated?
1pt is 1/72 of an inch, which is 1.333px at 96 dpi. A percentage is taken of the base font size, so 150% of 16px is 24px.
Read the guide
Learn how this works and how to get the most from it.
Web & SEO
px vs rem vs em: Which CSS Unit Should You Use?
The difference between px, rem and em in CSS, how to convert between them, and when each one is the right choice.
3 min read
Related tools
CSS Gradient & Box Shadow Generator
Design gradients and box shadows visually and copy the CSS.
CSS Minifier & Beautifier
Compress CSS to save bytes, or format it so it is easy to read.
Unit Converter
Convert length, weight, temperature, volume, speed and more.
Color Converter & Contrast Checker
Convert HEX, RGB and HSL and check WCAG contrast ratios.