How px, rem, em, and percent relate
Pixels are the most direct size label in CSS, but `rem`, `em`, and `%` are relative. This calculator models all three relative units against the selected base font size so you can compare font-size values without recalculating the ratios manually.
In many design systems, the practical starting point is a 16 px root size. Under that assumption, 16 px equals 1 rem, 24 px equals 1.5 rem, and 32 px equals 2 rem. If the root size changes, those relationships change too.
rem = px / root font size
Converts a pixel value into root-relative units.
px = rem × root font size
Converts a rem value back into pixels.
percent = (px / root font size) × 100
Expresses the same size as a percentage of the base font size.