Convert between px, rem, em, vw, vh, %, and pt instantly. Configure base font size and viewport dimensions for accurate responsive design calculations.
px
16px
rem
1rem
em
1em
vw
0.8333vw
vh
1.4815vh
%
100%
pt
12pt
<html> element's font size. With the default 16px base, 1rem = 16px. Using rem makes your design scale with the user's browser font size setting. Use this px to rem converter to switch easily.By default, 1rem = 16px (since most browsers use a 16px root font size). However, if the user or CSS changes the root font size, the conversion changes accordingly. Use the "Base Font Size" setting above to match your project's configuration.
Use rem in most cases. It provides consistent sizing relative to the root font size, making it predictable. Use em only when you want sizing to be relative to the parent element (e.g., padding inside a component that should scale with its own font size).
vw is always relative to the viewport (browser window) width, regardless of parent elements. % is relative to the parent element's size, which depends on context. For fluid typography and full-width layouts, vw is more predictable.
With a 16px base font size: 30px / 16 = 1.875rem. Enter 30 in the value field, select "px" as the unit, and this converter will show you the rem equivalent instantly. You can also adjust the base font size if your project uses a different root size.