What is the difference between px and rem?
A px is a fixed CSS unit, while 1rem equals the font size of the root html element, which is 16px in every browser by default. Sizing text, spacing and layout in rem means everything scales together when a user raises the default font size in their browser settings, an important accessibility requirement (WCAG 1.4.4, Resize Text). The conversion is simple: rem = px / root font size, so 24px is 1.5rem with a 16px base. em works the same way but is relative to the font size of the parent element, which compounds when elements are nested.
Features
- • Two-way px and rem conversion with a custom root font size
- • Also shows pt and percentage equivalents
- • Table of common sizes from 1px to 128px, clickable
- • Bulk converter that rewrites every px value in a CSS snippet
- • Option to keep 1px hairline borders in px
Runs locally
All conversions happen in your browser, including the CSS you paste. Nothing is uploaded.