Pixel to REM Converter (Instant PX to REM & Custom Base Size)
Convert Pixels (px) to REM units instantly for responsive web design.
This free online tool helps you calculate the REM equivalent of any pixel value based on your project’s root font size. Whether you are coding a WordPress theme or a React app, our px to rem calculator ensures your typography is accessible and scalable.
How to Use the PX to REM Converter
-
Set your Base Size: Most modern browsers use a default of 16px.
-
Enter Pixels (px): Type the value from your design (e.g., Figma or Sketch).
-
Get REM Result: The tool calculates the value automatically.
- Reverse Conversion: Need to go the other way? Use our Rem to Pixel Converter for instant results.
Video tutorial: How to use pixels to rem converter
What is a REM unit?
REM stands for “Root EM.” It is a CSS unit that is relative to the font size of the root element (usually the <html> tag).
The Pixel to REM Formula
If you want to calculate the conversion manually, use this simple formula:
REM = Pixels/Base Font Size
Example: If your base font size is 16px and your element is 24px, the calculation is 24 / 16 = 1.5rem.
Why Use REM instead of Pixels?
Using REM units is a “best practice” in modern web development for three main reasons:
-
Accessibility: If a user increases their browser’s default font size for better visibility, your REM-based layout will scale proportionally. Pixel-based layouts remain “frozen” and can break readability.
-
Responsive Design: You can change the entire scale of your website by adjusting a single value in your CSS root.
-
Consistency: REM units prevent “compounding issues” often found with EM units, where nested elements grow or shrink unexpectedly.
PX to REM Conversion Table (Base 16px)
Developers frequently use these standard values for spacing and typography.
| Pixel | Rem |
|---|---|
| 1 px | 0.0625 rem |
| 2 px | 0.125 rem |
| 3 px | 0.1875 rem |
| 4 px | 0.25 rem |
| 5 px | 0.3125 rem |
| 6 px | 0.375 rem |
| 7 px | 0.4375 rem |
| 8 px | 0.5 rem |
| 9 px | 0.5625 rem |
| 10 px | 0.625 rem |
| 11 px | 0.6875 rem |
| 12 px | 0.75 rem |
| 13 px | 0.8125 rem |
| 14 px | 0.875 rem |
| 15 px | 0.9375 rem |
| 16 px | 1 rem |
| 17 px | 1.0625 rem |
| 18 px | 1.125 rem |
| 19 px | 1.1875 rem |
| 20 px | 1.25 rem |
| 21 px | 1.3125 rem |
| 22 px | 1.375 rem |
| 23 px | 1.4375 rem |
| 24 px | 1.5 rem |
| 25 px | 1.5625 rem |
| 32 px | 2 rem |
| 48 px | 3 rem |
| 64 px | 4 rem |
Frequently Asked Questions (FAQ)
How many pixels (PX) are in 1 REM?
By default, 1 REM equals 16 pixels in most modern browsers. This is because the standard root font size (html) is set to 16px. However, if you change your base font size in CSS or if a user adjusts their browser's accessibility settings, this value will scale accordingly.
What is the formula to convert PX to REM?
To convert pixels to REM, use the formula: REM = Pixels / Base Font Size. For a standard 16px base, 32px would be 2 REM (32 / 16). For a 10px base, 32px would be 3.2 REM (32 / 10).
Why use REM instead of PX for web design?
Using REM units is critical for web accessibility. Unlike pixels, which are absolute and fixed, REM units are relative to the user's browser settings. If a visually impaired user increases their default font size, your entire layout will scale proportionally, ensuring the site remains readable and compliant with WCAG standards.
What is the difference between REM and EM?
The main difference is the reference point: REM (Root EM) is always relative to the root element (html), while EM is relative to the font size of its parent element. REM is generally preferred for global consistency, while EM is useful for components that need to scale based on their specific container.
Is it okay to use 1px borders with REM units?
Most developers recommend keeping 1px borders in pixels. Converting extremely small values to REM can lead to sub-pixel rendering issues where a border might disappear or look blurry on certain screens. For structural spacing and typography, use REM; for fine decorative details, PX is still the standard.
How do I convert REM back to Pixels?
To convert REM to Pixels, you simply multiply the REM value by your base font size (REM * Base). For a faster way to handle these calculations, check out our dedicated REM to Pixel Converter: https://www.pixelconverter.com/rem-to-pixel-converter/.