Pixel snapping and corner fit

Two calculations a layout needs the measurements for: where a line falls on the pixel grid, and how close a frame's corner may come to the display's rounded corner.

This device

Your browser's screen size, pixel ratio and safe-area insets, and the measured device closest to them. Nothing leaves the page except the closest device's id, in the usage event the privacy page lists.

This part reads your screen once the page's script runs.

Pixel snapping

A line whose edges fall between pixels lights the pixels it partly covers in a blended colour, and looks soft. Put thin lines and edges on multiples of one pixel: one pixel is 1 ÷ scale in points, and 160 ÷ dpi in dp.

16.5 pt is 49.5 px on the iPhone 17: between pixels. The edges either side are 16.333 pt (49 px) and 16.667 pt (50 px); the nearest is 16.667 pt.

Pixels per unitOne pixelDevices
2 px per pt0.500 ptiPhone SE (3rd generation), iPad mini (A17 Pro), iPad mini (A20 Pro), iPad (A16), iPad Pro 11-inch (M5), iPad Pro 13-inch (M5)
3 px per pt0.333 ptiPhone 16e, iPhone 16, iPhone 16 Pro Max, iPhone 17, iPhone 17 Pro, iPhone 17 Pro Max, iPhone 17e, iPhone Air, iPhone 18 Pro, iPhone 18 Pro Max, iPhone Duo
3 px per dp0.333 dpSmall Android phone (360 × 780 dp)
2.63 px per dp0.381 dpPixel 8, Pixel Fold
2.44 px per dp0.410 dpPixel 9 Pro Fold
2 px per dp0.500 dpPixel Tablet

Corner fit

The display's rounded corner clips anything drawn under it. For a square corner at distances dx and dy from the two edges that meet at a corner of radius R, the corner lies R − √((R − dx)² + (R − dy)²) inside the curve; a negative value is how much the curve cuts off. A frame near a corner keeps an even gap to the curve when its own radius is the concentric radius, R minus its distance from the edges. Below, the frame stands at the system's content margin from the side, on each device's bottom-left corner.

On the iPhone 17 (corner radius 62 pt), a square corner 16 pt from the side and 34 pt from the bottom lies 8.15 pt inside the curve. A rounded corner of radius 28 pt keeps an even gap to the display's corner.

DeviceCorner radiusContent marginBottom insetCorner on the safe area's bottom edgeCorner at the margin from both edgesConcentric radius
iPhone 165516iOS 27.3 beta3410.71 insidecut off by 0.1539
iPhone 176216iOS 27.3 beta348.15 insidecut off by 3.0546
iPhone 17e47.3316iOS 27.3 beta3413.28 inside3.02 inside31.33
iPhone Air6220iOS 27.3 beta3411.52 inside2.6 inside42
iPhone 18 Pro6216iOS 27.3 beta348.15 insidecut off by 3.0546
iPhone 18 Pro Max6220iOS 27.3 beta3411.52 inside2.6 inside42
iPhone Duo820iOS 27.3 beta3420 inside20 inside0
iPad mini (A20 Pro)4720iOS 27.3 beta208.82 inside8.82 inside27
iPad (A16)2520iOS 27.3 beta2017.93 inside17.93 inside5
iPad Pro 11-inch (M5)3020iOS 27.3 beta2015.86 inside15.86 inside10
iPad Pro 13-inch (M5)3020iOS 27.3 beta2015.86 inside15.86 inside10

Lengths are in each device's unit. The radius is the display profile's; the margin is SwiftUI's contentMargins(for: .container) as read on the runtime named.