DPI to PPI Converter Formula

Understand the math behind the dpi to ppi converter. Each variable explained with a worked example.

Formulas Used

Pixels Per Inch (PPI)

ppi = diagonal_inches > 0 ? diagonal_px / diagonal_inches : 0

Pixel Size

pixel_size = diagonal_inches > 0 ? 25.4 / (diagonal_px / diagonal_inches) : 0

Total Pixels

total_pixels = width_px * height_px

Variables

VariableDescriptionDefault
width_pxScreen Width(px)1920
height_pxScreen Height(px)1080
diagonal_inchesDiagonal Size(inches)24
diagonal_pxDerived value= sqrt(pow(width_px, 2) + pow(height_px, 2))calculated

How It Works

Screen PPI Calculation

PPI = sqrt(W² + H²) / Diagonal Inches

Where W and H are the pixel dimensions.

Common Screen PPI

| Device | Approx PPI | |---|---| | 24" 1080p monitor | 92 | | 27" 4K monitor | 163 | | iPhone 15 | 460 | | iPad Pro | 264 |

Worked Example

1920x1080 display, 24-inch diagonal.

width_px = 1920height_px = 1080diagonal_inches = 24
  1. 01Diagonal pixels = sqrt(1920² + 1080²) = 2203
  2. 02PPI = 2203 / 24 = 91.8 PPI
  3. 03Pixel size = 25.4 / 91.8 = 0.277 mm

Ready to run the numbers?

Open DPI to PPI Converter