Pixels to REM Converter (PX to REM)
Easily convert pixels (PX) to REM with our free online PX to REM converter. REM (Root EM) is a font-relative unit commonly used in CSS for scalable and responsive designs. Use this tool to quickly calculate the REM equivalent of any pixel value and ensure consistent typography across your web projects.
Steps to Use the Converter:
Follow these simple steps to convert Pixels (PX) to REM:
- Enter the Base Font Size value.
- Input the Pixels value you want to convert.
- Press Enter or click the Convert button.
What is the Root Element?
The root element in an HTML document is the <html> tag, which defines the base font size for REM calculations in CSS.
How to Set Font-Size on the Root Element?
There are three ways to apply font-size to the <html> element:
-
Inline Style
<html style="font-size: 18px;">
-
Internal Stylesheet
<style> html { font-size: 18px; } </style> -
External Stylesheet
<link rel="stylesheet" type="text/css" href="styles.css">
html { font-size: 18px; }
How to Convert PX to REM?
The base font size on the root element determines REM calculations in CSS.
-
PX to REM Conversion Formula
REM = PX / Base Font Size -
Example Calculation
If the root font-size is
18px, and you need to convert36pxinto REM:REM = 36px / 18px
REM = 2So, 36px is equal to 2rem when the root font-size is 18px.
Common Pixels to REM Conversions:
| PX | REM |
|---|---|
| 4px | 0.25rem |
| 8px | 0.5rem |
| 12px | 0.75rem |
| 16px | 1rem |
| 20px | 1.25rem |
| 24px | 1.5rem |
| 32px | 2rem |
| 40px | 2.5rem |
| 48px | 3rem |
| 64px | 4rem |
| 96px | 6rem |
| 128px | 8rem |
| 160px | 10rem |
| 176px | 11rem |
| 192px | 12rem |
| 208px | 13rem |
| 224px | 14rem |
| 256px | 16rem |
| 320px | 20rem |
| 480px | 30rem |
| 576px | 36rem |
| 768px | 48rem |
| 800px | 50rem |
| 960px | 60rem |
| 992px | 62rem |
| 1024px | 64rem |
| 1120px | 70rem |
| 1200px | 75rem |
| 1280px | 80rem |
| 1440px | 90rem |
| 1600px | 100rem |