PX to REM Converter
Convert between pixels and rem units for responsive CSS. Change the root font size if your site doesn’t use the default 16px.
| Pixels | REM |
|---|
🔒 Everything you type stays in your browser. Nothing is sent to a server.
By Shah Rukh, software developer · Last updated:
PX to REM formula
rem = px ÷ root font size · px = rem × root font size
With the default browser font size of 16px, 24px = 24 ÷ 16 = 1.5rem.
Why use rem?
rem sizes scale with the user’s browser font setting. If someone sets a larger default font for readability, a site built in rem grows with it; one built in px doesn’t. That’s better for accessibility.
rem vs em: rem is always relative to the root (html) font size; em is relative to the parent element, so it compounds when nested.
Frequently asked questions
What is 1rem in pixels?
16px by default, unless the site changes the html font size.
Should I use rem for everything?
Use rem for font sizes and spacing. Borders and hairlines are often fine in px.
What about the 62.5% trick?
Setting html { font-size: 62.5% } makes 1rem = 10px. Set the root size to 10 here to convert.
Related tools
QR Code Generator
Free QR codes for links, Wi-Fi, text and contacts.
Color Picker & Palette
HEX, RGB and HSL codes plus matching palettes.
Contrast Checker
Check WCAG AA/AAA colour contrast for text.
Base64 Encoder / Decoder
Encode or decode Base64 text (UTF-8 safe).
URL Encoder / Decoder
Percent-encode or decode URLs and query strings.
Binary / Hex Converter
Convert between binary, octal, decimal and hex.