Px to Em Converter
Instantly convert px em with our free converter. See conversion tables, formulas, and step-by-step explanations. Enter your values for instant results.
Reviewed by Manoj Kumar, Mathematics Educator
Formula
Em = Pixels / Base Font Size | Rem = Pixels / 16 | Points = Pixels x 0.75
Em is calculated by dividing the pixel value by the parent element font size. Rem always uses the root font size (default 16px). Points equal pixels multiplied by 0.75 (since 1pt = 1/72 inch and 1px = 1/96 inch at standard resolution). Percentage equals (pixels / base) x 100.
Worked Examples
Example 1: Converting Heading Size to Em
Problem:A heading is 24px with a base font size of 16px. What is the em value?
Solution:Em = pixels / base font size\nEm = 24 / 16 = 1.5 em\nRem = 24 / 16 = 1.5 rem\nPoints = 24 x 0.75 = 18 pt\nPercent = (24 / 16) x 100 = 150%
Result:24px = 1.5em = 1.5rem = 18pt = 150%
Example 2: Converting Em to Pixels
Problem:A margin is set to 2.5em with a parent font size of 14px. What is the pixel value?
Solution:Pixels = em x base font size\nPixels = 2.5 x 14 = 35px\nRem = 35 / 16 = 2.1875 rem\nPoints = 35 x 0.75 = 26.25 pt
Result:2.5em at 14px base = 35px = 2.1875rem = 26.25pt
References
Reviewed by Manoj Kumar, Mathematics Educator ยท Editorial policy