PX to REM Converter
Convert CSS pixel sizes to rem.
Result
How it is calculated
In CSS, 1 rem equals the font size of the root element. The tool divides the pixel value by that base size: rem = px / base. If you leave the base empty or enter a value that is not positive, it uses 16 px, the usual browser default. It also gives points with pt = px × 0.75, since CSS defines 96 px as 72 pt.
Both results are rounded to two decimals. Negative pixel values are converted as they are. The conversion only holds for the base you give: if the page sets html { font-size: 62.5% } the root size is 10 px, and users who raise the browser's default font size will see rem values scale with it, while px values do not.
Worked example
You want a 24 px heading and the page base font size is 16 px. rem = 24 / 16 = 1.5. Points = 24 × 0.75 = 18. The tool shows 1.50 rem and 18.00 pt, so in CSS you can write 1.5rem for this heading.
Common mistakes
- Assuming 1 rem is always 16 px; it follows the root font size of the page, which may be changed.
- Mixing up rem with em: em depends on the parent element, rem on the root.
- Using the points result for screen sizes; points are meant for print and the tool's 0.75 factor is a CSS definition.
- Entering the root size in the pixel field and the target size in the base field.
About this calculator
This converter turns a pixel value into rem units by dividing by a base font size (16px by default, since that's the typical browser default), and also shows the equivalent in points. Because rem is relative to the root font size, this is exactly the math a browser does in reverse when it renders rem-based CSS.
Front-end developers use it constantly when converting a design file's pixel measurements (from Figma or Sketch) into the rem units used in a CSS stylesheet, which keeps typography and spacing scaling properly when a user changes their browser's font size.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
One catch for media queries: browsers resolve rem there against the initial font size of the browser, not against a smaller or larger size you set on the html element. So a breakpoint of 48rem does not follow a 62.5% root trick, and only the browser default counts. Inside the page itself, the base you enter should match your root size. Which base size do your projects use?