Calculator: CSS length units
Enter the labelled inputs to calculate: Result (pt); Result (rem); Result (in).
Enter a finite value within the formula’s domain and supported numeric range.
How the calculation works
pt=px·72/96; rem=px/root; in=px/96
Input and output units are stated explicitly. US liquid gallons and thermochemical calories are used where applicable; CSS uses 96 pixels per inch. This converts units, not material properties or device performance.
Values must satisfy the formula’s domain. Nonzero results too small or too large for reliable representation are rejected.
Frequently asked questions
How is the result calculated?
pt=px·72/96; rem=px/root; in=px/96
What assumptions apply?
Input and output units are stated explicitly. US liquid gallons and thermochemical calories are used where applicable; CSS uses 96 pixels per inch. This converts units, not material properties or device performance.
How precise are the displayed results?
Numerical results show up to ten significant digits. Rounding does not improve the accuracy of the input measurements or the model. Values must satisfy the formula’s domain. Nonzero results too small or too large for reliable representation are rejected.
How we verified this calculator
The calculator is checked against 3 reference cases computed independently from the sources below. Last passed: .
| # | Inputs | Expected result |
|---|---|---|
| 1 |
Pixels (px) = 16
Root font size (px) = 16
|
Result (pt): 12
Result (rem): 1
Result (in): 0.1666666667
|
| 2 |
Pixels (px) = 96
Root font size (px) = 16
|
Result (pt): 72
Result (rem): 6
Result (in): 1
|
| 3 |
Pixels (px) = 24
Root font size (px) = 20
|
Result (pt): 18
Result (rem): 1.2
Result (in): 0.25
|
Sources
- CSS Values and Units Module Level 4, §6.2 Absolute Lengths (1in = 2.54cm = 96px; 1pt = 1/72 in) — World Wide Web Consortium (W3C)