# PX to REM Converter

> At a 16px root, 24px = 1.5rem, 16px = 1rem, and 12px = 0.75rem. Enter any positive pixel value or change the root font size, then copy your rem result.

- **Source:** DevDreaming (https://devdreaming.com)
- **Canonical URL:** https://devdreaming.com/tools/px-to-rem-converter
- **Category:** Frontend & CSS
- **Price:** Free - no signup

---

## PX to REM formula and common values

Divide the pixel value by the root font size in pixels to get rem. With a 16px root, 8px = 0.5rem, 12px = 0.75rem, 16px = 1rem, 18px = 1.125rem, and 24px = 1.5rem.

Use the computed font size of your page's root html element. If your project uses an 18px root, the same 24px design value becomes 24 / 18 ~= 1.3333rem. Change Root Font Size above to update the result and the common conversions together.

## How to use it

1. Set Root Font Size to the computed font size of your project's html element. Use 16px if that is your base.
2. Enter the pixel value you want to convert in the Pixel Value field.
3. Read the Conversion Result card for the rem value and division used. The em figure assumes the relevant font size matches the chosen root size.
4. Use the preset buttons (Small, Regular, Large, Extra Large) to load common values quickly.
5. Select a size in Common Conversions to load it into the converter.
6. Click the copy icon to copy the rem or em value, or press Ctrl+L to reset the fields.

**[Open the PX to REM Converter tool ->](https://devdreaming.com/tools/px-to-rem-converter)**

This tool runs in your browser and cannot be operated from this Markdown copy - open the link above to use it.

## What you can use it for

- Converting a design handoff measured in pixels into rem units for an accessible, scalable stylesheet.
- Migrating an existing pixel-based CSS file to rem so it respects user font size preferences.
- Checking the rem equivalent of a spacing or font-size value while writing a component.
- Recalculating a spacing or font-size value for a project with a different root font size.
- Teaching or learning how the px-to-rem formula works using the shown division.
- Looking up common conversions like 24px to rem without doing mental math.

## Key features

- Live conversion that updates as you type, with results shown to four decimal places.
- Adjustable root font size for projects with a custom base.
- A reference table of common pixel sizes with clickable values.
- One-click copy of the rem result or the em figure calculated at the same base size.

## Frequently asked questions

### How do you convert px to rem?

Divide the pixel value by the root font size. With the standard 16px root, 24px divided by 16 equals 1.5rem and 8px equals 0.5rem. This converter applies that formula automatically and lets you change the root size if your project uses a different base.

### What is 16px in rem?

16px equals 1rem when the root font size is 16px, which is the default in most browsers. If you change the root size, the result changes accordingly, since rem is always relative to the root.

### What is the difference between rem and em?

A rem is relative to the root html element's font size. An em depends on context: for font-size it uses the parent's font size, and for many other properties it uses the element's own font size. The em figure here assumes that relevant size equals the root size you entered.

### Why should I use rem instead of px in CSS?

Rem units scale with the computed root font size. If you leave the root size relative to the user's default, rem-based text and spacing can grow with that preference.

### Is this px to rem converter free to use?

Yes. The converter is completely free, requires no signup, and runs entirely in your browser. No values you enter are sent to a server.

### Can I convert rem back to px with this tool?

This tool converts pixel input into rem and em output. To go the other way, multiply the rem value by your root font size: at a 16px root, 1.5rem times 16 equals 24px.

## Privacy

All tools on DevDreaming run entirely in your browser - your input is never uploaded to a server.

---

## Related on DevDreaming

- [All Free Developer Tools](https://devdreaming.com/tools)
- [Frontend & CSS Tools](https://devdreaming.com/tools/category/frontend-css)
- [Clamp() Calculator](https://devdreaming.com/tools/clamp-font-size-calculator)
- [Aspect Ratio Calculator](https://devdreaming.com/tools/aspect-ratio-calculator)
- [Cursor CSS Previewer](https://devdreaming.com/tools/cursor-property-viewer)
- [CSS Triangle Generator](https://devdreaming.com/tools/triangle-generator)
- [Box Model Visualizer](https://devdreaming.com/tools/css-box-model-visualizer)
- [CSS Variables Generator](https://devdreaming.com/tools/css-variables-generator)

---

_This is the Markdown twin of a page on **DevDreaming** - free developer tutorials, tools, and AI resources. Source of truth: the canonical HTML URL above._