Pixels to REM Converter
Convert any pixel value to REM units for responsive CSS in seconds. Set a custom base font size to match your project's root font size exactly.
Result in REM
1rem
16px ÷ 16 = 1rem
Quick reference (base 16px)
Quick answer
To convert pixels to REM, divide the pixel value by the root (base) font size. With the default browser base of 16px, 16px equals 1rem, 24px equals 1.5rem, and 32px equals 2rem. REM units scale relative to the root font size, making them ideal for accessible, responsive layouts. Use this converter to get the precise REM value for any pixel measurement in your CSS.
Formula & method
rem = px / baseFontSize
- rem — The result in REM units
- px — The pixel value to convert
- baseFontSize — The root font size in pixels (usually 16px)
Divide the pixel value by the root font size (default 16px in most browsers).
Examples
- Input
- 16px ÷ 16 base
- Result
- 1rem
- Why
- Dividing 16 by the default base font size of 16 gives exactly 1rem. This is the most common conversion in CSS.
- Input
- 24px ÷ 16 base
- Result
- 1.5rem
- Why
- 24 divided by 16 equals 1.5, so 24px is 1.5rem. This is a typical line-height or heading font size conversion.
- Input
- 32px ÷ 16 base
- Result
- 2rem
- Why
- 32 divided by 16 equals 2, so 32px is 2rem. A common conversion for large headings or component spacing.
- Input
- 10px ÷ 10 base
- Result
- 1rem
- Why
- Some developers set the root font size to 10px (62.5% of 16px) for easier mental math. With base 10, 10px equals exactly 1rem.
Frequently asked questions
What is a REM unit in CSS?
REM stands for 'root em'. It is a CSS unit that is relative to the font size of the root element (the <html> element). Unlike em, which is relative to the parent element, REM is always relative to the single root, making it more predictable for responsive design.
What is the default base font size in browsers?
Most browsers default to 16px as the base font size for the root element. Unless your CSS explicitly changes the font size on the html element, 1rem equals 16px. Many developers use html { font-size: 62.5%; } to make 1rem equal 10px for simpler calculations.
Why use REM instead of pixels?
REM units scale with the user's browser font size preference, improving accessibility. If a user increases their browser's default font size, all REM-based values scale accordingly. Fixed pixel values do not respond to these preferences, which can harm readability for low-vision users.
How do I convert pixels to REM manually?
Divide your pixel value by the root font size. For example, with the default 16px base: 24px ÷ 16 = 1.5rem. If your root font size is 10px: 24px ÷ 10 = 2.4rem. The formula is always rem = px / baseFontSize.
Can I use a custom base font size in this converter?
Yes. This converter lets you set any base font size in pixels. If your project uses html { font-size: 62.5%; } (which equals 10px), enter 10 as the base. The converter will then compute REM values relative to that custom base.
Does changing REM affect all elements on the page?
Changing the root font size affects all elements that use REM units. Elements using em, px, or other absolute units are not affected. This global scaling behavior is what makes REM a powerful tool for building accessible, user-preference-aware layouts.
Sources & references
- https://developer.mozilla.org/en-US/docs/Web/CSS/length#rem
- https://www.w3.org/TR/css-values-4/#rem
- https://css-tricks.com/rem-global-em-local/
External references open in a new tab. We are independent and not affiliated with these organizations.
- ✓ Free to use
- ✓ No sign-up required
- ✓ Runs entirely in your browser — nothing is uploaded.
- ✓ Formula and method shown above
Provided “as is” for general information only — results may be inaccurate, so verify before you rely on them. No warranty; use at your own risk.
Built and reviewed by HIFreeTools against the formula shown above and any authoritative references cited on this page. See our methodology and editorial standards.
Related tools
- Slope CalculatorCalculators
- Pythagorean Theorem CalculatorCalculators
- Percentage CalculatorCalculators
- Scientific CalculatorScience & Engineering
Embed this tool on your site
Free to embed, no sign-up. Paste this code where you want the pixels to rem converter to appear: