PX to REM Converter
Convert px to rem and em based on the root font size.
24px1.5rem1.5emrem is relative to the root font size (default 16px). em is relative to the parent; here it matches rem at the chosen base.
About the PX to REM Converter
rem and em units keep CSS scalable and accessible, but you often start from a pixel value in a design.
This converter turns px into rem and em for your chosen root font size, and works both ways, so you can move between units without doing the maths.
It runs in your browser.
Key features
- px to rem and em
- Adjustable root font size
- Two-way conversion
- Copy any value
How to use
- 1Enter a pixel value.
- 2Set the root font size if it is not 16px.
- 3Copy the rem or em value.
- 4Use a positive, nonzero root size matching your project's computed root font size; this tool does not inspect your site's CSS. Zero is not guarded against and does not give a meaningful conversion.
- 5You can also edit rem to calculate pixels. Changing the root size preserves the current pixel value and recalculates rem; results are rounded to four decimal places.
Examples
24px at 16px root1.5remDividing the pixel value by the root font size gives the rem value.
Frequently asked questions
- What is the default root font size?
- The tool starts at 16px, a common browser default. Browser preferences and your root CSS can change the actual value, so enter the base your project uses.
- What is the difference between rem and em?
- rem uses the root element's font size. For most other properties, em uses the element's computed font size; in font-size itself, em is relative to the inherited font size. The em card here simply reuses the chosen base, so it only matches your CSS when that context uses the same size.
- Why use rem instead of px?
- rem makes sizes follow the root font size and can help layouts respond to user font preferences. That benefit depends on how the root is defined; the conversion alone does not make a design accessible.
Continue your workflow
Open a related tool to prepare your files or refine the finished result.
- CSS & DesignCSS clamp() Generator
Build a fluid clamp() value for responsive type and spacing.
Open tool - CSS & DesignCSS Flexbox Generator
Build a flexbox layout visually and copy the CSS.
Open tool - ConvertersScreen Density Converter (dp, px, pt)
Convert dp and pt to pixels across Android densities and iOS scales.
Open tool
