ποΈ PX to REM Converter β CSS Pixel and Root Font Size
Enter a pixel size and the root font size used by the page. The converter shows the rem value and can turn rem back into pixels for the same root.
How it works
- Set the root font size. 16px is the usual browser default.
- Enter a pixel value and press Convert px to rem, or enter rem and press Convert rem to px.
- Copy the CSS value. 1rem always equals the root font size you entered.
Examples
- 16px at a 16px root is 1rem.
- 24px at a 16px root is 1.5rem.
- 1.25rem at an 18px root is 22.5px.
Frequently asked questions
What is a rem?
A rem is a CSS length equal to the font size of the root element, usually the html element. It does not depend on the parent element's font size the way em does.
Why would I change the root size?
Some designs set html { font-size: 62.5% } so 1rem is 10px, or they use a larger root for accessibility. Match the root used by the stylesheet.
Does this change my website?
No. It only calculates the equivalent length so you can paste it into CSS.
Related tools
More Design tools βColor Contrast Checker
Measure WCAG contrast between two hex colors for text and interface graphics.
Aspect Ratio Calculator
Solve width, height and simplified aspect ratios without breaking proportions.
Color Palette Generator
Generate five hex tints and shades from a single base color.
CSS Specificity Calculator
Calculate CSS selector specificity as an (inline, ID, class, element) tuple.