- Set the Base Font Size to match your project's root HTML font size (default is 16px).
- Locate the 'Pixels (px)' input field.
- Enter the specific pixel value you want to convert into REMs.
- View the automatically calculated REM value in the output field.
- Copy the calculated REM unit to use in your CSS, SCSS, or responsive framework.
PX to REM Converter
PX to REM Converter tool on AzWebTools.
Result
Fill inputs and click run.
How to Use This Tool
Learn More About PX to REM Converter
What is a REM unit in CSS?
REM stands for 'Root EM'. It is a relative CSS unit used in web development to define sizes—such as typography, margins, padding, and layout dimensions—relative to the font size of the root <html> element.
Why use REM instead of Pixels (px)?
Pixels are absolute units. If a developer hardcodes font-size: 16px;, the text remains exactly 16 pixels regardless of user preferences. REM units, however, respect the user's browser settings. If a user with visual impairments increases their browser's default font size to 24px, a layout built with REMs will automatically and proportionally scale up. Relying on REM units is a fundamental best practice for web accessibility and meeting WCAG (Web Content Accessibility Guidelines) compliance.
The PX to REM Conversion Formula
The math behind converting pixels to REM is a straightforward division: REM Value = Target Pixel Value ÷ Root Pixel Size
For example, if your root font size is the standard 16px and you need to convert a 24px heading: 24 ÷ 16 = 1.5rem
The CSS 62.5% Trick
Historically, many developers used the font-size: 62.5%; trick on the <html> element. Because 62.5% of the default 16px is exactly 10px, it simplifies the mental math (e.g., a 24px value becomes 2.4rem). However, with modern developer tools, CSS preprocessors (like Sass), and PX to REM calculators, most modern workflows stick to the standard 100% (16px) base size to avoid altering browser defaults unnecessarily.
The Origin of REM Units in CSS
- Introduced in
- CSS3 Specification
- Standard Base Size
- 16px
- Primary Purpose
- Accessible Responsive Scaling
Examples
Standard Text (16px)
{"pixels":"16","baseFontSize":"16"}{
"pixels": "16",
"baseFontSize": "16"
}Small Text (14px)
{"pixels":"14","baseFontSize":"16"}{
"pixels": "14",
"baseFontSize": "16"
}H1 Heading (32px)
{"pixels":"32","baseFontSize":"16"}{
"pixels": "32",
"baseFontSize": "16"
}10px Base Font (64px)
{"pixels":"64","baseFontSize":"10"}{
"pixels": "64",
"baseFontSize": "10"
}Sample Scenario
{"pixels":24,"baseFontSize":16}{
"pixels": 24,
"baseFontSize": 16
}Use Cases
- Translating Figma, Adobe XD, or Sketch pixel-based designs into responsive CSS, SCSS, or LESS code.
- Configuring custom utility classes and spacing scales in CSS frameworks like Tailwind CSS, Bootstrap, or Foundation.
- Improving web accessibility (WCAG compliance) by ensuring typography and layouts scale proportionally with a user's browser font settings.
- Standardizing responsive spacing, including margins, paddings, and CSS grid gaps across a web application.