Convert px to mm

11,031

Solution 1

The correlation between pixels and physical measurements depends entirely on the display and how many physical pixels there are per (square) millimeter. 72ppi (pixels per inch) used to be a typical resolution, but with pixel density increasing across many devices, that's not a given anymore.

There's simply no standard formula.

Solution 2

The resulting pixel number depends on the DPI (resolution) of the output media.

Starting with 90mm equaling ~3,54in you get:

72dpi:  255px
96dpi:  340px
120dpi: 425px
146dpi: 517px
Share:
11,031
Linas
Author by

Linas

Geeky programmer

Updated on June 04, 2022

Comments

  • Linas
    Linas almost 2 years

    I am creating business card maker online, now so far everything was easy until i came to card rendering. In my html document i have:

    width = 517px which is equals to 90mm
    height = 287px which is equals to 50mm

    And according to Photoshop 90mm -> 255px so I need to somehow convert 517px to 255px.

    After some googling best solution i came up with so far is (517 / 5.7) * 3 which gives me 272 and it's far from correct answer.

    Any suggestions would help a lot :)

    P.S I am using php GD.