PX to REM Converter

This PX to REM Converter turns pixel values into rem units and back again for CSS

Updated
Loading tool…

This PX to REM Converter turns pixel values into rem units and back again for CSS

How to use PX to REM Converter

  1. Set the root font size (base) in pixels, or leave it at the default 16.
  2. Type a pixel value to get rem, or type a rem value to get pixels.
  3. Copy the result, or use the reference table for common sizes.
Try next →CSS Formatter & BeautifierThis free CSS formatter cleans up messy or minified stylesheets in one step

About PX to REM Converter

This PX to REM Converter turns pixel values into rem units and back again for CSS. It uses the standard formula rem = px ÷ base and px = rem × base, where the base is your root (html element) font size. The base defaults to 16px because that is the browser default, so 1rem = 16px out of the box.

Both directions convert live as you type, and you can set any base you like. That matters if your project changes the html font-size, for example the common 62.5% trick that sets the base to 10px so 1rem equals 10px. A quick reference table shows the rem equivalents of the pixel sizes people use most, recalculated whenever you change the base.

The tool runs entirely in your browser with plain arithmetic. Nothing is uploaded, and there is no network call or sign-up. Results are rounded to four decimal places for readability, which is more than enough precision for CSS.

Frequently asked questions

How do I convert px to rem?
Divide the pixel value by your root font size. At the default 16px base, 24px = 24 ÷ 16 = 1.5rem. Enter the pixel value in the Pixels field and the rem result appears instantly.
What base font size should I use?
Use 16 unless your CSS overrides the html element's font-size. Browsers default to 16px, so 1rem = 16px. If you set html { font-size: 62.5% } your base becomes 10px, so change the base field to 10.
Is the conversion accurate?
Yes. It is exact arithmetic (px divided or multiplied by the base), rounded to four decimals only for display. rem is a real number, so values like 14px become 0.875rem with no loss that matters for CSS.
Can it convert rem back to pixels?
Yes, it works both ways. Type a rem value in the REM field to see the pixel equivalent at your chosen base, using px = rem × base.
Does rem or px depend on the parent element?
No. rem is always relative to the root html font size, unlike em, which is relative to the parent element's font size. This tool converts rem, so only the root base matters.
Is my data sent anywhere?
No. All calculations happen locally in your browser with JavaScript. There are no uploads, no network requests, and no sign-up required.