Last updated: February 03, 2024

Pixel Density — PPI Calculator

Created by

What is a PPI Calculator?

The Pixels Per Inch (PPI) calculator is a tool to determine the pixel density of any screen on a computer, laptop, tablet, smartphone, or other display device. This tool measures the pixel density of a display by counting the number of pixels in a one-inch diagonal line.

PPI Formula

To calculate a screen PPI, you will need to provide the following information:

  • Diagonal (in) - screen diagonal or screen size measured in inches.
  • Width (px) - the horizontal resolution measured in pixels.
  • Height (px) - the vertical resolution measured in pixels.
Pixels Per Inch (PPI) definition and formula
Definition and formula of Pixels Per Inch (PPI)

The Pythagorean Theorem can be used to calculate a screen's diagonal length in pixels based on its width and height in pixels.

$${\text{diagonal (px)}} = \sqrt{\text{width}^2 + \text{height}^2}$$

To determine the number of pixels per inch (PPI), divide the screen's diagonal length in pixels by the diagonal length of the screen in inches.

$${\text{PPI}} = \frac{\text{diagonal (px)}}{\text{diagonal (in)}}$$

The term pixels per inch, or PPI, is the screen pixel density measurement unit. It represents the number of pixels per 1 inch of the physical screen line. Since pixels are square and symmetrical, the PPI remains the same regardless of whether the inch is horizontal, vertical, or diagonal.

How do you calculate a screen PPI?

To determine the PPI of a screen, use the PPI formula. Check out the example below for a step-by-step guide on how to calculate screen PPI.

Find a screen PPI of the Apple iPhone 15 Pro Max.

According to the official specifications of the iPhone 15 Pro Max[1], the phone has a screen size of 6.7 inches and a resolution of 1,290 x 2,796.

Use the formula below to calculate the number of pixels across the diagonal line.

$${\text{diagonal (px)}} = \sqrt{\text{width}^2 + \text{height}^2}$$ $${\text{diagonal (px)}} = \sqrt{{1290}^2 + {2792}^2}$$ $${\text{diagonal (px)}} = 3,079.24\text{ px}$$

Then, divide the diagonal length in pixels by the diagonal length in inches.

$${\text{PPI}} = \frac{\text{diagonal (px)}}{\text{diagonal (in)}}$$ $${\text{PPI}} = \frac{3,079.24\text{ px}}{6.7 \text{ in}}$$ $${\text{PPI}} = 459.59 \text{ PPI} ≈ 460 \text{ PPI}$$

So, the PPI of the iPhone 15 Pro Max is 460 PPI.

PPI vs. DPI

When discussing an image's resolution, we often hear the terms DPI and PPI. These terms are frequently used interchangeably, but they have different meanings.

  • DPI refers to the number of dots a printer puts down on a square inch of a printed image
  • PPI refers to the number of tiny colored squares that make up an image on a computer screen.

To understand the difference, think of DPI as the number of dots a printer can produce in a printed image, while PPI is the number of pixels a computer screen can display in an image.[2]

Pixels Per Inch (PPI) vs. Dots Per Inch (DPI)
Pixels Per Inch (PPI) vs. Dots Per Inch (DPI)

What is the Density-independent Pixel (DP)?

Android and Apple have introduced their measurement units for density-independent pixels to ensure that the user interface (UI) maintains a consistent size across devices with varying display densities.

This unit is known as DP (density-independent pixels) on Android devices, while on Apple devices, it is called Points [3]. These units allow developers to specify the size of UI elements independently of the device's pixel density (PPI), which can vary widely across devices of different sizes and resolutions.

By using DP or Points, developers can ensure that their apps look and feel consistent across a wide range of devices, which is especially important given the wide variety of devices on the market today.

The density-independent pixel (dp—all small caps) is the measurement unit for designing UI on screens with different pixel densities (PPI). In a medium or baseline density (160 dpi), one projected pixel equals one pixel on the screen.

Pixel Density Classification

Screen density is essential to designing an Android application that displays correctly on devices with varying screen sizes and resolutions. Android's support document[4] offers designers and developers a comprehensive guide outlining seven screen density classifications.

These classifications include LDPI (low density), MDPI (medium density), HDPI (high density), XHDPI (extra high density), XXHDPI (extra-extra high density), XXXHDPI (extra-extra-extra high density), and TVDPI (television density). Each of these classifications represents a specific range of pixels per inch (PPI) on a device's screen, and designers can use this information to create optimized resources for each class.

Pixel Density Comparison

Use the table below to determine a device's screen density by comparing its pixels per inch (PPI) to the corresponding PPI range for each classification.

ClassPPINameFactor
LDPI< 120Low0.75
MDPI120 - 160Medium1
TVDPI160 - 213Television1.33
HDPI213 - 320High1.5
XHDPI320 - 480Extra High2
XXHDPI480 - 640Extra Extra High3
XXXHDPI> 640Extra Extra Extra High4
Screen density classification

Example: What's the Google Pixel 8 Pro screen density classification?

Based on the official Google Pixel 8 Pro hardware tech specs[5], it has a pixel density of 489 PPI.

Therefore, the Google Pixel 8 Pro has a XXHDPI (Extra Extra High) screen density screen.

DP to PX formula

Here is the formula to convert from the density-independent pixel units (dp) to pixel units (px).

$${\text{px}} = \text{dp} \times \frac{\text{dpi}}{160}$$

See the examples below to learn more about converting from density-independent pixel units to actual screen pixel units.

Example: MDPI Screen

You want to draw a 0.5-inch line on a tablet with a pixel density of MDPI or 160 dpi. How many density-independent pixels (dp) and pixels (px) should you write in your code to achieve the desired output?

Use the following steps to solve the problems.

  • The baseline or MDPI pixel density classification has 160 dp per inch.
  • So 0.5 inch has 160/2 = 80 dp.
  • Since the baseline density is 1 dp = 1px, the actual pixels used to draw the line are 80 pixels.
$${\text{px}} = \text{dp} \times \frac{\text{dpi}}{160}$$
$${\text{px}} = 80\text{ dp} \times \frac{160\text{ dpi}}{160}$$
$${\text{px}} = 80\text{ px}$$

So, to draw a 0.5-inch line on an MDPI screen, you need to specify the length in either 80dp or 80px.

Example: XXHDPI Screen

With the same objective in the example above, How many density-independent pixels (dp) and pixels (px) should you specify in your design to draw a 0.5-inch line on a tablet with a pixel density of XXHDPI or 480 dpi?

Use the following steps to solve the problems.

  • The baseline or MDPI pixel density classification has 480 dp per inch.
  • So 0.5 inch has 480/2 = 240 dp.
  • Use the formula below to calculate the pixels to draw the 0.5-inch line.
$${\text{px}} = \text{dp} \times \frac{\text{dpi}}{160}$$
$${\text{px}} = 240\text{ dp} \times \frac{480\text{ dpi}}{160}$$
$${\text{px}} = 240\text{ dp} \times 3$$
$${\text{px}} = 720\text{ px}$$

So, to draw a 0.5-inch line on an XXHDPI screen, you need to specify the length as 240dp or 720px.

FAQs

1. What is the difference between Dots Per Inch (DPI) and Density Independent Pixels Per Inch (dpi)?

Despite having the same abbreviation, the density-independent pixels per inch are often written in small caps. They also have a completely different meaning.

  • Dots Per Inch (DPI) is a printing term that refers to the number of ink dots a printer can put on a square inch of paper to create a printed image.
  • Density-independent Pixels per Inch (dpi) is a screen term used to design a consistent size on screens with different pixel densities (PPI).

User Guide

This guide provides step-by-step instructions for using our calculator.

Pixel Density — PPI Calculator

How do you use a pixel density or PPI calculator?

To calculate the pixel density of a display or a TV using our calculator, use the following options.

Option 1: Please select your preferred device from our presets.

Pixel Per Inch (PPI) Calculator - Device Presets

Select a screen information from a preset

Option 2: Enter your device's screen information, including the screen's diagonal, horizontal, and vertical resolutions.

Pixel Per Inch (PPI) Calculator - Input Fields

Manually enter your screen information.

When you complete either of the options, our PPI calculator will calculate and show the following information:

  1. Image preview visualizes the difference between the pixelation of the calculated PPI.
  2. PPI value shows the screen pixel density's rounded value and decimal values.
  3. Pixel density qualifiers show you the pixel density qualifier that your screen has.
  4. Screen preview shows you the screen shape labels for physical diagonal, width, height, and resolutions.

Pixel Per Inch (PPI) Calculator - Result

Screen preview and information

On top of the above information, our calculation also offers the following information for your further reference, including:

  • Total pixels
  • Pixels per square inch or configured unit
  • Amount of pixels over the diagonal.
  • Aspect ratio
  • Dot Pitch

Pixel Per Inch (PPI) Calculator - Details

Screen detailed information

Pixel Density — PPI Calculator

About this app

Pixel Density — PPI Calculator

Our PPI calculator is the perfect tool to accurately calculate and explore the pixel density of any screen on mobiles, monitors, and TVs.

Availability

You can use the calculator for free as a PWA web app online or install it locally on any modern operating system, including Android, iOS, Windows 11/10, and macOS.

Pixel Density — PPI Calculator QR
Scan Me
Use Pixel Density — PPI Calculator as Web AppGet Pixel Density — PPI Calculator from Google Play StoreDownload Pixel Density — PPI Calculator on the Microsoft StoreGet Pixel Density — PPI Calculator from Amazon Appstore
Similar Calculators

References

5 Sources

  1. ⬆️ iPhone 15 Pro Max - Technical Specifications - Apple Support. Apple Support. Published 2023. Accessed May 6, 2024.

    https://support.apple.com/en-us/111828
  2. ⬆️ What is the difference between Dots Per Inch (DPI) and Pixels Per Inch (PPI)? | Sony USA. Sony.com. Published 2019. Accessed May 6, 2024.

    https://www.sony.com/electronics/support/articles/00027623
  3. ⬆️ Displays. Apple.com. Published October 30, 2017. Accessed May 6, 2024.

    https://developer.apple.com/library/archive/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/Displays/Displays.html
  4. ⬆️ Android Developers. Published 2024. Accessed February 4, 2024.

    https://developer.android.com/training/multiscreen/screendensities
  5. ⬆️ Pixel phone hardware tech specs - Pixel Phone Help. Google.com. Published 2019. Accessed May 8, 2024.

    https://support.google.com/pixelphone/answer/7158570#zippy=%2Cpixel-pro