How-to guide
How to convert px to rem for CSS
Press ⌘K with TabCmdr and type 24px to rem to get 1.5rem, based on a 16px root. If your root font size is different, add it at the end: 24px to rem at 10.
Quick answer
Convert px to rem in three steps
- ⌘K
Step 1
Open the palette
Ctrl+K on Windows and Linux. Works on any page.
- 24px to rem
Step 2
Type the size
The rem value shows at the top of the list.
- ↵
Step 3
Press Enter
The value is copied, ready to paste into your CSS.
How px and rem relate
A rem is the font size of the page’s root element, usually <html>. A common browser default is 16px, but people can change it in their settings and your CSS can set its own. So to turn pixels into rem, divide by the root size: 24px at a 16px root is 1.5rem.
An em works the same way, but it’s relative to the font size of the element itself, which usually comes from its parent.
Source: MDN’s CSS length units page, checked in October 2026.
TabCmdr's way
Convert px to rem in the TabCmdr palette
TabCmdr is a keyboard launcher that lives in your browser. Its search box does the division for you, so you don’t need a converter tab open while you write CSS.
Before you start: add TabCmdr from the Chrome Web Store. It has a 7-day free trial and needs no account.
Step 1: Open the palette
Press ⌘+K on a Mac or Ctrl+K on Windows and Linux, on any page.
Step 2: Type the size and the unit you want
Type 24px to rem. The answer, 1.5rem, shows under Calculator at the top of the list. TabCmdr uses a 16px root unless you tell it otherwise.

24px to rem gives 1.5rem with a 16px root.Step 3: Press Enter to copy
The answer row is already highlighted. Press Enter and TabCmdr copies the value and closes the palette, ready to paste into your stylesheet. A “Copied 1.5rem” message shows at the bottom of the page.
Use your own root size
If your site sets a different root font size, add it at the end with at, base or @:

24px to rem at 10 gives 2.4rem.| You type | You get |
|---|---|
24px to rem at 10 | 2.4rem |
24px to rem @ 10 | 2.4rem |
32px to rem base 20 | 1.6rem |
14px in rem | 0.875rem |
1.5rem to px | 24px |
18px to em | 1.125em |
2em to px | 32px |
em is worked out from the same base as rem, so check that your parent element’s font size matches before you use the result.
If no answer shows up
- The number has no unit.
24 to remdoesn’t say what to convert from. Write24px to rem. - The unit isn’t px, rem or em. These three are the CSS sizes TabCmdr converts. For other units, like
12 inches to cm, see the calculator page.
Try it on your own tabs
Works in Chrome, Edge, Brave, Arc, Vivaldi and Opera.