PX to REM Converter
Convert pixels to rem and em for responsive CSS.
Convert between px, rem and em using a custom root font size and see a quick table of common values.
Loading the interactive tool… This page needs JavaScript to run the PX to REM Converter.
How to use PX to REM Converter
- Choose your colors or values.
- Preview the result live.
- Tweak until it looks right.
- Copy the CSS or code into your project.
How PX to REM Converter works
Enter a value, choose px to rem or rem to px, and set the base font size, which defaults to 16 pixels. The tool divides or multiplies by that base and rounds to four decimals. Below the main result it lists a reference table for common sizes from 8 to 64 pixels using the same base, so you can see a whole type scale at once.
Worked example
Input 24 px with base font size 16 → Output 1.5rem, and the table also shows 8px as 0.5rem, 12px as 0.75rem and 64px as 4rem.
Common uses
- Converting a design file's pixel sizes into rem units for accessible CSS.
- Working out rem values when a project sets html font-size to 10px or 62.5%.
- Keeping a quick table of spacing sizes while writing a responsive stylesheet.
Best for
- responsive design
- accessible font sizing
- CSS refactoring
Tips for better results
- Set the base size to match your project root.
- Check color contrast for accessibility.
- Test designs on light and dark backgrounds.
- Keep a copy of final values in your design system.
Frequently asked questions
How many px is 1rem?
By default 1rem is 16px, but it depends on the root font size of the page.
Why use rem instead of px?
Rem units scale with user font-size settings, which improves accessibility.
Is my data sent to a server?
No. This tool runs in your browser, so what you enter stays on your device.
Related tools
- Image to Base64 Converter — Convert an image to a Base64 data URI in your browser locally in your browser.
- RGB to HEX Converter — Convert RGB values to HEX and HSL with a color preview.
- Box Shadow Generator — Design CSS box shadows visually and copy the code.
- Color Palette Generator — Generate harmonious color palettes from a base color.
- Color Shades Generator — Generate a 10-step tint and shade scale from any color.
- CSS Border Radius Generator — Design rounded corners per corner and copy the CSS.