px (pixels) is the most common CSS unit โ fixed size regardless of parent. rem (root em) is relative to the root HTML font size (typically 16px by default in browsers). em is relative to the parent element's font size. vw/vh are percentages of the viewport width and height โ 1vw = 1% of viewport width. pt (points) is used for print media: 1pt โ 1.333px.
Using rem instead of px for font sizes and spacing makes layouts more accessible โ when a user increases their browser font size, rem-based layouts scale accordingly while px-based ones do not.
Frequently Asked Questions
By default 1rem = 16px (browser default root font size). You can change the base in the converter settings above.
rem is relative to the root (html) element font size โ it's consistent everywhere. em is relative to the parent element font size, which can chain and compound in nested elements.
Set your viewport height above, enter your px value, and the vh result shows automatically. Formula: vh = px / viewportHeight ร 100.
16px = 1rem at the default browser font size of 16px.
rem is recommended for font sizes โ it respects the user's browser font size preferences, making your site more accessible. Use px for borders, shadows and decorative elements that should not scale.