CSS Units

Convert px / rem / em with a custom root size.

A free CSS unit converter between px, rem and em, with a configurable root font size (default 16px). Enter a value and unit to see the equivalents live — handy for building scalable, responsive styles. It runs entirely in your browser.

How to use

  1. Enter a value and pick its unit (px / rem / em).
  2. Set the root font size (default 16).
  3. Read the equivalents in the other units and copy them.

FAQ

What root size should I use?
Most browsers default to a 16px root, so 16 is the usual choice. If you set a custom font-size on :root or html, use that value instead.
What is the difference between rem and em?
rem is always relative to the root font size; em is relative to the parent element’s size and compounds with context. This tool converts using the root size you provide as a quick reference.

Related tools