Type a pixel value and get the rem value instantly, or type rem and get pixels. The root font size is 16 px by default, which is what every major browser uses unless the visitor changes it, but you can set any base, for example 10 px if your stylesheet uses the 62.5% trick.
Using rem for font sizes, spacing and layout lets your site scale when people increase their browser's text size, which is an important part of accessibility. The table below the converter lists the most common sizes so you can copy values without calculating.
How to use the PX to REM Converter tool
- Check the root font size (16 px unless your CSS sets another value on
html). - Type a value in Pixels to get rem, or in REM / EM to get pixels.
- Copy the CSS line, or pick a value from the table.
Why use ToolOrca PX to REM Converter
- PX to REM and REM to PX
- Any root font size
- Conversion table that follows your base
- Copyable CSS
- Works for em values too
- Runs offline
PX to REM formula
rem = px ÷ root font size, and px = rem × root font size. With the default 16 px root: 24 px = 24 ÷ 16 = 1.5rem, 14 px = 0.875rem and 1rem = 16 px.
REM versus EM
rem is relative to the root (html) font size, so 1rem is the same everywhere on the page. em is relative to the font size of the current element's parent, so it compounds when you nest elements: 1.2em inside 1.2em is 1.44 times the base. Use rem for most sizes and em when something should scale with its own text, such as padding inside a button.
Frequently asked questions
How many pixels is 1rem?
1rem equals the root font size, which is 16px in all major browsers by default.
What is 16px in rem?
16px is 1rem with the default root size. 12px is 0.75rem, 14px is 0.875rem, 18px is 1.125rem and 20px is 1.25rem.
What is the 62.5% trick?
Setting html { font-size: 62.5%; } makes 1rem equal 10px, so 1.6rem is 16px. Set the root size to 10 here to convert with that setup.
Should I use px or rem for font size?
Rem is recommended because it respects the user's browser font-size setting. Pixel font sizes ignore that setting in many browsers.
Can I convert px to em with this tool?
Yes. Set the base to the parent element's font size and the result is the em value.