CSS Unit Converter
Convert a length between the common CSS units px, rem, em and pt. Set the root font size that rem and em are relative to, type a value, and read the result in every other unit. Everything runs in your browser.
How to convert CSS units
- Set the root font size if it is not the default 16px.
- Enter a value and choose the unit you are converting from.
- Read or copy the equivalent value in px, rem, em and pt.
Examples
Pixels to rem
16px at base 16
1rem
Points to pixels
12pt
16px
Frequently asked questions
How do you convert px to rem?
Divide the pixel value by the root font size. At the default root size of 16px, 16px is 1rem, 24px is 1.5rem, and 8px is 0.5rem.
How many pixels is 1pt?
CSS defines 1pt as 1/72 of an inch and 1 inch as 96px, so 1pt equals 96/72 px, about 1.3333px. That makes 12pt exactly 16px.
What is the difference between rem and em?
rem is relative to the root font size, while em is relative to the font size of the current element. This tool converts both against the base you set, which is the common case for sizing.
Why would I use rem instead of px?
rem scales with the user's root font size, so layouts respect browser and accessibility settings. Many designers size typography and spacing in rem for that reason.
Is anything sent to a server?
No. The conversion runs in your browser, so your values never leave your device.
Related tools
Color Mixer
Mix two hex colors online and get the blend. Set the mix ratio with a slider to find the perfect in-between color, then copy the hex result.
Gradient Generator
Generate CSS gradient code from color stops online. Pick colors, set the angle, switch between linear and radial, then copy the gradient.
Binary to Decimal
Convert binary to decimal online. Paste any binary number, with or without spaces, and get the exact base-10 value instantly. Runs in your browser.
Binary to Hex
Convert binary to hexadecimal online. Paste a binary number and get exact hex, with optional uppercase. Handles huge values. Runs in your browser.
Binary Translator
Translate text to binary and binary back to text online. UTF-8 accurate, handles emoji and accents, with a copy button. Runs in your browser, nothing uploaded.
Celsius to Fahrenheit
Convert Celsius to Fahrenheit instantly. Type a temperature in C and get F, with the formula and a quick reference table. Runs in your browser.