PX to REM Converter
Convert pixel values to REM units instantly. Enter your PX value and base font size to get the exact REM equivalent for your CSS — free, no signup required.
Enter a pixel value above to see the REM equivalent
Formula: REM = PX ÷ Base Font Size
What is PX to REM Conversion?
PX (pixels) is a fixed CSS unit — 24px is always 24px regardless of the user's browser settings. REM (Root EM) is a relative unit that scales based on the root element's font size (typically 16px in browsers). Converting PX to REM makes your CSS flexible and accessible.
The formula is simple: REM = PX ÷ Base Font Size. With the default base of 16px, 24px becomes 1.5rem, 32px becomes 2rem, and so on.
How to Use the PX to REM Converter
- Enter your pixel value in the Pixel Value (px) field.
- Set the Base Font Size — leave it at 16 unless your project uses a custom root font size.
- The REM result appears instantly with the full formula shown.
- Click Copy to copy the result to your clipboard.
- Click Reset to clear all fields and start over.
Why Use REM Instead of PX?
- Accessibility: REM scales when users increase their browser font size in accessibility settings. PX does not.
- Responsive design: Changing the root font size with a media query scales your entire layout proportionally.
- Consistency: REM gives you a single control point — adjust the root size and everything adjusts with it.
- Modern CSS best practice: Most modern style guides and frameworks recommend REM for font sizes and spacing.
PX to REM Conversion Table
Reference table using the standard 16px base font size.
| Pixels (px) | REM (base 16px) | CSS Usage |
|---|---|---|
| 4px | 0.25rem | border radius, small spacing |
| 8px | 0.5rem | icon size, tight padding |
| 12px | 0.75rem | small text, captions |
| 14px | 0.875rem | secondary text |
| 16px | 1rem | body text (1rem = base) |
| 18px | 1.125rem | slightly larger body |
| 20px | 1.25rem | h5, subheadings |
| 24px | 1.5rem | h4, card titles |
| 28px | 1.75rem | h3 |
| 32px | 2rem | h2, section headers |
| 40px | 2.5rem | h1, hero text |
| 48px | 3rem | display text |
| 64px | 4rem | large display headings |
REM vs PX — When to Use Each
Use REM for font sizes, padding, margin, and layout spacing that should scale with user preferences. Use PX for borders, box shadows, and elements where an exact fixed size is required regardless of the user's font settings.
Frequently Asked Questions
What is 1px in REM?
With a default base font size of 16px, 1px equals 0.0625rem. The formula is: REM = PX ÷ Base Font Size.
What is the default base font size for REM conversion?
Most browsers set the default root font size to 16px, which means 1rem = 16px. You can change the base font size in our converter if your project uses a different root font size.
How do I convert PX to REM?
Divide the pixel value by the base font size. For example, 24px ÷ 16 = 1.5rem. Use our free PX to REM converter to get instant results without any manual calculation.
Why should I use REM instead of PX in CSS?
REM units are relative to the root font size, making your design scale proportionally when users change their browser font size settings. This improves accessibility and creates a more responsive layout across all devices.
Can I set a custom base font size?
Yes. Our converter has a Base Font Size input field where you can enter any value. This is useful if your project uses a root font size other than the default 16px.
Is this PX to REM converter free?
Yes, this tool is completely free with no signup, no login, and no hidden charges. Simply enter your pixel value and get the REM result instantly.
Related Developer Tools
Base64 Encoder / Decoder
Encode and decode Base64 instantly.
Border Radius Generator
Generate CSS border-radius visually with live preview.
Box Shadow Generator
Generate CSS box shadows visually with live preview.
Color Palette Generator
Create harmonious color palettes from any color.
Color Picker
Pick colors and get HEX, RGB, HSL, CMYK instantly.
CSS Formatter / Beautifier
Format and beautify CSS code instantly.
CSS Gradient Generator
Generate linear, radial, and conic CSS gradients visually.
CSS Minifier
Minify CSS code instantly in browser.
CSS to SCSS Converter
Convert flat CSS to idiomatic nested SCSS instantly.
HEX to RGBA Converter
Convert HEX colors to RGB/RGBA instantly.




