PX to REM Converter
A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call
Free px to rem converter. Convert pixels to rem and rem to pixels at any root font size, with em, points and percent, plus a size table to copy.
- Pixels
- 0
- REM
- 0
- EM
- 0
- Points
- 0
- Percent
- 0
Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.
How to use the px to rem converter
Enter a value, choose its unit (px, rem, em, pt or %), and set the root font size if it isn't the usual 16 pixels. The px to rem converter instantly shows the same size in:
- Pixels (px)
- REM
- EM
- Points (pt)
- Percent (%)
Below is a table of common sizes, from 8px to 96px, with their rem and point values for your root font size, ready to copy into your CSS. Everything is calculated in your browser.
For example, at the default root size of 16px, 24px = 1.5rem, 14px = 0.875rem and 18px = 1.125rem.
The px to rem formula
rem = px ÷ root font size px = rem × root font size
With a 16px root: 24 ÷ 16 = 1.5rem, and 0.75rem × 16 = 12px.
What rem, em, px and pt mean
- px (pixel): a fixed CSS unit. In CSS, 1px is defined as 1/96 of an inch, which doesn't always equal one physical pixel on high-resolution screens.
- rem (root em): relative to the font size of the root element (
<html>). Browsers default to 16px, so 1rem is usually 16px. - em: relative to the font size of the current element (or its parent, for font-size). It compounds when nested: 1.2em inside 1.2em is 1.44 times the base size.
- pt (point): a print unit, 1/72 of an inch, so 1px = 0.75pt and 12pt = 16px.
- %: for font sizes, a percentage of the parent's font size: 100% equals 1em.
The px to rem converter's em and percent figures assume the parent has the same font size as the root.
Why use rem instead of px?
Accessibility. Many people increase the default font size in their browser settings because they find small text hard to read. If you set font sizes in px, those settings are ignored for your text. With rem, a visitor who sets their default to 20px sees everything scale up proportionally: 1.5rem becomes 30px instead of 24px.
Rem also makes design systems simpler: change one root size and the whole scale changes together, and sizes don't compound unexpectedly like em does.
Good practice:
- Use rem for font sizes, so text respects browser settings.
- Use rem or em for spacing that should grow with text, such as padding on buttons.
- Use px for things that shouldn't scale, such as hairline borders (
1px). - Don't set the root font size in px. Setting
html { font-size: 16px; }overrides visitors' settings. Leave it alone, or use a percentage.
The 62.5% trick
Some developers set html { font-size: 62.5%; }, which makes 1rem equal 10px with the default browser setting, so 2.4rem = 24px is easy to work out. It still respects visitors' settings, because it's a percentage. The downside: third-party components that assume 1rem = 16px end up tiny. If you use it, set the root font size to 10 in the px to rem converter.
Common conversions (16px root)
| Pixels | REM | Typical use |
|---|---|---|
| 12px | 0.75rem | Small print, captions |
| 14px | 0.875rem | Secondary text |
| 16px | 1rem | Body text |
| 18px | 1.125rem | Large body text |
| 20px | 1.25rem | Lead paragraphs |
| 24px | 1.5rem | Small headings |
| 32px | 2rem | Headings |
| 48px | 3rem | Large headings |
| 64px | 4rem | Display text |
Points for print and design tools
Designers often specify type in points from print or design apps. Because 1pt = 1.333px, a 12pt body size is 16px (1rem), 18pt is 24px (1.5rem) and 9pt is 12px. Select "pt" as the unit to convert.
Fluid type with clamp()
Modern CSS can scale text smoothly between screen sizes:
h1 { font-size: clamp(2rem, 1.5rem + 2vw, 3.5rem); }
This keeps headings between 2rem (32px) and 3.5rem (56px). Use rem for the minimum and maximum so the text still respects browser settings.
Line height and spacing
- Line height works best without units:
line-height: 1.5scales with each element's font size. - Spacing scales: many design systems use multiples of 0.25rem (4px): 0.5rem, 0.75rem, 1rem, 1.5rem, 2rem.
- Readable line length: about 60 to 75 characters per line, often set with
max-width: 65ch.
Related tools for designers and developers
- CSS minifier: compress your CSS.
- Aspect ratio calculator: sizes for images and video.
- Color contrast checker: make sure your text is readable.
- HEX to RGB converter: convert colour codes.
- Image resizer: resize images to exact pixel sizes.
- HTML table generator: clean table code.
How rem respects your visitors
Here's what happens when a visitor changes their browser's default font size from 16px to 20px (Settings → Appearance → Font size in Chrome, for example):
| Your CSS | Default 16px | Visitor's 20px |
|---|---|---|
| font-size: 16px | 16px | 16px (ignored) |
| font-size: 1rem | 16px | 20px |
| font-size: 1.5rem | 24px | 30px |
| padding: 1rem | 16px | 20px |
With px, the visitor's preference is ignored. With rem, everything scales together, so the layout stays balanced and the text is readable. Browser zoom (Ctrl and +) scales both px and rem, but the font size setting only affects relative units, and many people with low vision rely on it.
Converting a whole stylesheet
To convert an existing site from px to rem:
- Decide your root size. Leave it at the browser default unless you have a reason.
- Convert font sizes first, using the table above or the px to rem converter.
- Convert spacing that should grow with text: padding and margins around text, gaps in components.
- Leave hairlines in px: borders, outlines and box shadows.
- Convert media query breakpoints to em (for example, 48em instead of 768px), which makes them respond to the font size setting consistently across browsers.
- Test at the default size and at a larger browser font size.
Rounding
Rem values can have long decimals: 13px is 0.8125rem. Browsers handle decimals fine, so there's no need to round, but if your design system uses a spacing scale, round to the nearest step (0.75rem or 0.875rem) for consistency. The px to rem converter shows up to four decimal places so you can choose.
Using em for components
Em is useful inside components that should scale as a unit. A button with font-size: 1.125rem and padding: 0.5em 1em keeps its proportions whatever size the button text is, because the padding follows the button's own font size. Use rem for the font size, em for spacing within the component.
Pixels on high-resolution screens
A CSS pixel isn't always one screen pixel. On a high-resolution "Retina" display, one CSS pixel covers two or three physical pixels in each direction, so a 16px font is drawn with 32 or 48 device pixels and looks sharper. That's why CSS sizes work consistently across screens, and why images for these screens need two or three times as many pixels as their display size.
Quick mental conversions
With the default 16px root:
- Divide by 16: 8px is 0.5rem, 12px is 0.75rem, 20px is 1.25rem, 40px is 2.5rem.
- Multiply by 16: 1.5rem is 24px, 2.25rem is 36px, 3rem is 48px.
- Quarters are easy: each 0.25rem is 4px.
For anything else, the px to rem converter gives the exact figure.
Rem in email templates
Email apps vary widely in their CSS support, and some older clients handle rem poorly. For emails, pixels are still the safer choice for font sizes; use rem freely on websites and web apps, where browser support is universal.
A worked example
A bakery's designer hands over a mockup with type in pixels: 48px headings, 18px lead text, 16px body and 14px captions. The developer wants the site to respect visitors' font settings, so uses the px to rem converter with the default 16px root: 3rem, 1.125rem, 1rem and 0.875rem. The site looks identical to the mockup at default settings, and a customer who uses a larger browser font size now sees larger text everywhere, instead of tiny captions.
Need more customers from Google?
This tool is free and runs in your browser. If your business also needs more leads or sales, Google Ads is where people search with their wallet out. That is the whole job of DeepRit: a PPC-only agency that sets up and runs Google Ads accounts so every click is accounted for. You keep full ownership of your account, get a written report every week, and can stop at any time. See our pricing or ask for a free audit.
Frequently asked questions
How do I convert px to rem?
Divide the pixel value by the root font size. With the default 16px root, 24px is 1.5rem.
How many pixels is 1rem?
16px by default, because browsers set the root font size to 16px. If the root size changes, 1rem changes with it.
What's the difference between rem and em?
Rem is relative to the root font size; em is relative to the current element's font size, so it compounds when nested.
Should I use px or rem for font sizes?
Rem, so text respects visitors' browser font settings. Keep px for borders and fine details.
How do I convert pt to px?
Multiply by 4/3. 12pt is 16px, and 18pt is 24px.
Is the px to rem converter free?
Yes. It's free with no sign-up, and it works entirely in your browser.
Free PPC audit
See where your ad budget leaks.
We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.