PPI Calculator — Screen Pixel Density
Work out a screen's pixels per inch from its resolution and diagonal — plus dot pitch, pixels per cm, megapixels and the CSS device pixel ratio.
PPI Calculator
Background.
Two screens can share a resolution and look completely different. A 3840 × 2160 panel is "4K" whether it is a 27-inch monitor 60 cm from your face or an 85-inch television across the room, but the first packs 163 pixels into every inch and the second only 52. Pixel density — pixels per inch, PPI — is the number that captures that difference, and it is the number that actually predicts whether you will see the pixel grid, whether text will look crisp, and whether the operating system will scale the interface.
The calculation is one line of geometry. The pixel grid has exactly the same shape as the panel it sits on, so its diagonal in pixels is √(horizontal² + vertical²), and dividing that by the physical diagonal in inches gives the density. A 14.2-inch MacBook Pro at 3024 × 1964 has a pixel diagonal of 3 605.81, which over 14.2 inches is 253.93 ppi — the 254 ppi Apple prints on its own specification page. That agreement is worth noting: manufacturers and this calculator are doing the same arithmetic, and if a published PPI figure disagrees with the geometry, the published figure has been rounded or the quoted diagonal is not the viewable one.
Dot pitch is the same fact upside down. Where PPI counts pixels per inch, dot pitch measures the centre-to-centre distance between two neighbouring pixels: 25.4 divided by the PPI, in millimetres. Panel datasheets and monitor reviews often quote pitch instead of density, and the two are interchangeable — that MacBook panel has a 0.100 mm pitch, a 27-inch 4K monitor about 0.156 mm, a 55-inch 4K television about 0.317 mm. Pitch is the more intuitive number when you are thinking about whether individual pixels will be resolvable, because it is a physical length you can compare against the size of things you can see.
The third output most people come for is the CSS device pixel ratio, and it exists because of a definition rather than a measurement. The W3C's CSS Values and Units specification pins the CSS pixel to a reference pixel: the visual angle of one pixel on a 96 dpi device at arm's length — about 0.0213 degrees, roughly 0.26 mm, at a nominal 28 inches. The absolute-length table therefore fixes 1in = 96px. Windows uses the same anchor: Microsoft's high-DPI documentation records that DPI-unaware applications render at a fixed value of 96 DPI (100%), and that where displays used to be around 96 pixels per linear inch, panels near 300 DPI and above are now commonplace. Divide your panel's PPI by 96 and you have the scale factor the platform is working with.
The two secondary modes are for the design side of the same question. Given a resolution and a density you want to hit, the calculator returns the panel size that delivers it — useful when you are specifying a kiosk, a digital sign or a VR lens stack rather than buying a monitor. Given a size and a target density, it returns the pixel counts you would need, keeping the aspect ratio of the pair you entered and rounding to whole pixels, then reporting the density those whole pixels actually achieve. That last detail matters: pixel counts are integers, so a target density is almost never hit exactly, and quoting the rounded-integer result rather than the ideal is the honest answer.
One assumption runs through all of it: pixels are square. Every ITU-R display format specifies a pixel aspect ratio of 1:1, and every consumer panel built in the last two decades obeys it, which is what makes a single scalar density meaningful at all. Where that assumption breaks — anamorphic video formats, some legacy standard-definition sources — density stops being one number and becomes two, which is the pixel aspect ratio calculator's territory. This page also stays strictly on the display side of the PPI/DPI divide: printing DPI is a different quantity measured against a different denominator, and the print calculators handle it.
What is ppi calculator?
Pixel density is the number of pixels a display packs into one linear inch of its surface, written PPI (pixels per inch). It is computed from the pixel diagonal and the physical diagonal — PPI = √(width² + height²) ÷ diagonal — and it is the property that determines whether the pixel structure of a panel is visible at a given distance, not the resolution on its own.
Dot pitch is the reciprocal view of the same property: the centre-to-centre spacing of adjacent pixels, equal to 25.4 mm divided by the PPI. Both descriptions assume square pixels, which every modern display format guarantees. A closely related but distinct quantity is DPI in the printing sense, which counts ink dots per inch on paper rather than light-emitting elements on glass; the two are often used interchangeably in conversation and should not be. On the software side, both Windows and CSS treat 96 pixels per inch as the 1.0× baseline, so PPI ÷ 96 gives the device pixel ratio the platform applies when scaling an interface.
How to use this calculator.
- Leave the mode on the first option to find the density of a screen you already know the size of.
- Enter the native horizontal and vertical pixel counts — the panel's own resolution, not a scaled desktop resolution the operating system is reporting.
- Enter the advertised diagonal in inches. This is the viewable panel measurement, corner to corner, excluding the bezel.
- Read the PPI and the dot pitch: they are the same fact in two units, and datasheets quote one or the other.
- Check the CSS device pixel ratio if you are doing web or interface work — it is the PPI divided by 96, the scale factor CSS and Windows are built around.
- Switch to the second mode when you know the resolution and the density you want, and need the panel size that delivers it.
- Switch to the third mode when the panel size is fixed and you need the pixel counts; the aspect ratio of whatever pair you enter is preserved, so 16 and 9 work as well as 1920 and 1080.
- Compare the answer against your viewing distance separately — the TV size and viewing distance calculator turns a density into a distance at which pixels stop being resolvable.
The formula.
A display is a rectangle of pixels laid over a rectangle of glass, and because the pixels are square the two rectangles have exactly the same proportions. That means the diagonal of the pixel grid and the diagonal of the panel describe the same line, one counted in pixels and one measured in inches. The pixel diagonal comes straight from Pythagoras: √(pw² + ph²). Dividing it by the physical diagonal D gives pixels per inch. Nothing else about the panel is needed — not the width, not the height, not the aspect ratio — because the ratio of the two diagonals already carries all of it.
Running that on the 14.2-inch MacBook Pro panel: 3024² = 9 144 576 and 1964² = 3 857 296, so the sum is 13 001 872 and the pixel diagonal is 3 605.8109. Over 14.2 inches that is 253.9303 ppi, which rounds to the 254 ppi Apple publishes. The same arithmetic on a 27-inch 3840 × 2160 monitor gives 4 405.8143 ÷ 27 = 163.18 ppi, and on a 55-inch panel of that resolution 80.11 ppi — the resolution is identical and the density differs by a factor of two, which is the whole point of measuring density rather than counting pixels.
Dot pitch inverts it. If there are P pixels in an inch, each pixel occupies 1/P inch, and since the inch is exactly 25.4 mm by the NIST definition derived from the 1959 international yard, the pitch is 25.4 ÷ P millimetres, or 25 400 ÷ P micrometres. At 253.93 ppi that is 0.10003 mm, almost exactly a tenth of a millimetre.
The CSS ratio is a definition rather than a derivation. The W3C's CSS Values and Units module defines the reference pixel as the visual angle of one pixel on a 96 dpi device viewed at arm's length, and its absolute-length table sets 1in = 96px. Windows anchors to the same figure — DPI-unaware applications render at a fixed 96 DPI, which the system calls 100%. So the device pixel ratio is simply PPI ÷ 96: 2.65 for the MacBook panel, 1.70 for a 27-inch 4K monitor, 0.83 for a 55-inch 4K television, which is why a television used as a monitor makes interface text look oversized.
Both inverse modes fall out of the same equation. Solving PPI = √(pw² + ph²) ÷ D for D gives D = √(pw² + ph²) ÷ PPI, the panel size that delivers a target density for a fixed resolution. Solving for the pixel counts needs the physical width and height, which come from the aspect ratio r = pw ÷ ph as H = D ÷ √(r² + 1) and W = r·H; the required counts are then PPI·W and PPI·H. Those are rarely integers, so the calculator rounds them to whole pixels and recomputes the density the rounded grid actually achieves — at 14.2 inches and a 254 ppi target, 3 025 × 1 965 pixels, achieving 254.03 ppi.
A worked example.
Apple's specification page for the 14-inch MacBook Pro says: "14.2-inch (diagonal) Liquid Retina XDR display; 3024-by-1964 native resolution at 254 pixels per inch". Checking that against the geometry: 3024² = 9 144 576, 1964² = 3 857 296, and the sum is 13 001 872, whose square root is 3 605.8109 pixels across the diagonal. Dividing by the 14.2-inch panel gives 253.9303 ppi, which rounds to exactly the 254 Apple prints. The dot pitch is 25.4 ÷ 253.9303 = 0.10003 mm, or 100.03 µm — a pixel a tenth of a millimetre across. In metric density terms that is 253.9303 ÷ 2.54 = 99.97 pixels per centimetre, so almost exactly 100 pixels to the centimetre. The panel drives 3 024 × 1 964 = 5 939 136 pixels, which is 5.94 megapixels every frame. And because CSS defines one pixel as 1/96 inch, the device pixel ratio is 253.9303 ÷ 96 = 2.645, which is why macOS renders this display at a scaled 2× and why a web page's 1 px border is drawn with roughly two and a half physical pixels. Running the same panel through the second mode confirms the rounding: to land on exactly 254 ppi, that pixel grid would need a 14.1961-inch diagonal — four thousandths of an inch smaller than the real screen, which is the whole of the discrepancy between 253.93 and Apple's published 254.
Frequently asked questions.
How do I calculate PPI?
What is a good PPI for a monitor?
Is PPI the same as DPI?
What is dot pitch and how does it relate to PPI?
Why does my screen's PPI not match the manufacturer's figure exactly?
What is the CSS device pixel ratio and why is it PPI divided by 96?
Does higher PPI always mean a sharper image?
What resolution do I need for a given screen size and density?
Does PPI apply to phones and VR headsets the same way?
Can I use this for a projector or a projected image?
Why does the calculator assume square pixels?
How many megapixels is my screen?
References& sources.
- [1]National Institute of Standards and Technology, Office of Weights and Measures — SI Units: Length. 'The value for the inch, derived from the value of the Yard effective July 1, 1959, is exactly equivalent to 25.4 mm.'
- [2]W3C, CSS Values and Units Module Level 4 — the reference pixel is the visual angle of one pixel on a device with a device pixel density of 96dpi at a distance of an arm's length (approximately 0.0213 degrees, about 0.26 mm, nominal arm's length 28 inches / 71 cm); absolute-length table: 1in = 2.54cm = 96px.
- [3]Microsoft Learn — High DPI Desktop Application Development on Windows: 'In the past, most displays had 96 pixels per linear inch of physical space (96 DPI); in 2017, displays with nearly 300 DPI or higher are readily available', and 'DPI unaware applications render at a fixed DPI value of 96 (100%)'.
- [4]Apple — MacBook Pro (14-inch, 2021) Technical Specifications: '14.2-inch (diagonal) Liquid Retina XDR display; 3024-by-1964 native resolution at 254 pixels per inch'.
- [5]Recommendation ITU-R BT.709-6 (06/2015), Table 1 — aspect ratio 16:9, 1 920 samples per active line, 1 080 active lines per picture, pixel aspect ratio 1:1 (square pixels). International Telecommunication Union.
- [6]Recommendation ITU-R BT.2020-2 (10/2015) — 3 840 × 2 160 and 7 680 × 4 320 pixel counts, 16:9 aspect ratio, pixel aspect ratio 1:1 (square pixels). International Telecommunication Union.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 590 calculators remain free
- No billing is enabled