
CSS px to rem converter
Calculate css px to rem converter using the values and assumptions you provide.
Your inputs stay in your browser. Displayed results are rounded to a maximum of 12 significant digits.
Method and assumptions
Method version 1.0.0 · Updated
Calculate
Formula: rem = pixels / root font size
Calculate css px to rem converter using the values and assumptions you provide.
- pixels
- Size in pixels
- rootSize
- Root size (px)
Results depend on the assumptions entered; verify professional or safety-critical decisions independently.
Calculate with code
These short examples use the same inputs and core calculation as this tool. Adapt validation and formatting to your application.
JavaScript
const pixels = 24, rootFontSize = 16;
console.log(pixels / rootFontSize); // 1.5 remTypeScript
const pixels = 24, rootFontSize = 16;
console.log(pixels / rootFontSize); // 1.5 remPython
print(24 / 16) # 1.5 remJava
System.out.println(24.0 / 16); // 1.5 remC#
Console.WriteLine(24m / 16m); // 1.5 rem