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 unit | One pixel | Devices |
|---|---|---|
| 2 px per pt | 0.500 pt | iPhone 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 pt | 0.333 pt | iPhone 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 dp | 0.333 dp | Small Android phone (360 × 780 dp) |
| 2.63 px per dp | 0.381 dp | Pixel 8, Pixel Fold |
| 2.44 px per dp | 0.410 dp | Pixel 9 Pro Fold |
| 2 px per dp | 0.500 dp | Pixel 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.
| Device | Corner radius | Content margin | Bottom inset | Corner on the safe area's bottom edge | Corner at the margin from both edges | Concentric radius |
|---|---|---|---|---|---|---|
| iPhone 16 | 55 | 16iOS 27.3 beta | 34 | 10.71 inside | cut off by 0.15 | 39 |
| iPhone 17 | 62 | 16iOS 27.3 beta | 34 | 8.15 inside | cut off by 3.05 | 46 |
| iPhone 17e | 47.33 | 16iOS 27.3 beta | 34 | 13.28 inside | 3.02 inside | 31.33 |
| iPhone Air | 62 | 20iOS 27.3 beta | 34 | 11.52 inside | 2.6 inside | 42 |
| iPhone 18 Pro | 62 | 16iOS 27.3 beta | 34 | 8.15 inside | cut off by 3.05 | 46 |
| iPhone 18 Pro Max | 62 | 20iOS 27.3 beta | 34 | 11.52 inside | 2.6 inside | 42 |
| iPhone Duo | 8 | 20iOS 27.3 beta | 34 | 20 inside | 20 inside | 0 |
| iPad mini (A20 Pro) | 47 | 20iOS 27.3 beta | 20 | 8.82 inside | 8.82 inside | 27 |
| iPad (A16) | 25 | 20iOS 27.3 beta | 20 | 17.93 inside | 17.93 inside | 5 |
| iPad Pro 11-inch (M5) | 30 | 20iOS 27.3 beta | 20 | 15.86 inside | 15.86 inside | 10 |
| iPad Pro 13-inch (M5) | 30 | 20iOS 27.3 beta | 20 | 15.86 inside | 15.86 inside | 10 |
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.