This article refers to what you call logical pixels
as points
on iPhone and independent pixels (DP)
on Android.
It provides formulas on how to convert logical pixels to physical ones.
iOS:
physical pixels = points * DPI / 163
Android:
physical pixels = independent pixels * DPI / 163
DPI (aka PPI) is a Dot Per Inch or Pixel Per Inch is the number of physical pixels per inch.
Physical screen resolution and PPI can be easily obtained from sites like GSMArena. But as developers, we are more interested in logical resolution, and especially logical width.
Let's calculate the logical width for iPhone 14. Its physical resolution and PPI are 1170 x 2532 and 460 respectively:
logical width = 1170 * 163 / 460 = 415
For Samsung S23 (1440 x 3088 and 500 ppi):
logical width = 1440 * 160 / 500 = 460
For iPhone 5 (640 x 1136 and 326)
logical width = 640 * 163 / 326 = 320
px
pixels. When taken literally, every web page would appear way too small. So Apple invented the "logical pixel" measurement unit, whereas "physical pixels" are the ones you would see. (If only they weren't so darn small.) – Typhoondevice independent pixels
, is it something similar to logical pixel? – Campion