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.
Discord Server Template
Design channels and roles, then build them in one click.
Discord Moderation Bot
Make your own mod bot with kick, ban, mute and filters.
Discord Bot Maker
Build a custom Discord bot without coding.
Discord Welcome Bot
Custom welcome messages and auto-roles for new members.
Color Picker & Palette
HEX, RGB and HSL codes plus matching palettes.