Search tools...⌘K
Unit Converter
Convert common developer units.
CSS Unit Converter
Convert pixels to relative units (REM/EM) based on your root font size.
Absolute
px
16px ÷ 16 = 1.000rem
Relative
How to Use
- 1
Set Base Size
Default is 16px (standard browser root). Change this if your project uses a different root font size.
- 2
Enter Value
Type in Pixels to get REM/EM, or type in REM to get Pixels.
- 3
Copy Result
Clicking isn't needed—just copy the value from the field.
Frequently Asked Questions
REM (Root EM) allows users to scale their browser font size for accessibility. PX is fixed and hampers this ability.
Pixels / Base Size = REM. For example, 24px / 16px = 1.5rem.
EM is relative to the parent element's font size, whereas REM is relative to the root (html) element.
How to Convert Developer Units
- 1
Choose a category
Switch between CSS units, digital storage, and time using the tabs.
- 2
Enter a value
Type into either field — conversion runs both ways, so you can work forwards or backwards.
- 3
Adjust the base if needed
For PX and REM, set the root font size to match your project. The default is the browser standard of 16px.
Frequently Asked Questions
Divide the pixel value by the root font size, which is 16px in browsers by default. So 24px equals 1.5rem. Change the base value in the converter if your project sets a different root font size.
REM scales with the user's browser font-size setting, so text stays readable for people who increase it. Use REM for typography and spacing, and reserve PX for values that must not scale, such as hairline borders.
Both conventions exist. Storage vendors and SI use 1000 bytes per kilobyte, while operating systems and memory typically use 1024 (properly called a kibibyte). This converter shows both so you can match whichever your context expects.
JavaScript Date objects and many APIs count milliseconds since the Unix epoch, while Unix timestamps in most other languages count seconds. Mixing the two is a common source of dates landing in 1970 or far in the future.
No. Every conversion is arithmetic performed in your browser. Nothing is transmitted, logged, or stored.