What is the difference between REM and EM?
REM is relative to the root (html) element's font size. EM is relative to the parent element's font size. REM is generally safer for global consistency.
A comprehensive calculator for modern frontend developers. Sync all CSS units instantly across different base references.
CSS offers various units to help developers create layouts that work on any screen. Understanding the difference between absolute and relative units is key to modern web design.
Pixels (PX) are fixed. REM and EM are relative to font sizes. VW/VH are relative to the viewport. Using relative units ensures your site is accessible for users who increase their browser font size.
Value in REM = Pixels / Base SizeValue in Percent = (Pixels / Base Size) * 1001vw = 1% of Viewport Width1pt = 1.333px (assuming 96 DPI)REM is relative to the root (html) element's font size. EM is relative to the parent element's font size. REM is generally safer for global consistency.
Percent is relative to the parent container, while VW (Viewport Width) is always relative to the full browser window width.
It's the browser default. However, some developers set it to 62.5% (10px) to make math easier. You can change the 'Root Base' in our tool to match your config.