Xiaomi 15 vs iPhone 17: screen size and viewport
The Xiaomi 15 lays web pages out at 400 × 890 CSS px with a pixel ratio of 3; the iPhone 17 at 402 × 874 with 3. The iPhone 17 is 2 px wider, and the Xiaomi 15 is 16 px taller.
The two screens side by side
Specs compared
| Spec | Xiaomi 15 | iPhone 17 | Difference |
|---|---|---|---|
| Viewport, portrait (CSS px) | 400 × 890 | 402 × 874 | −2 px wide, +16 px tall |
| Device pixel ratio | 3 | 3 | same |
| Physical resolution | 1200 × 2670 | 1206 × 2622 | Xiaomi 15: 1% more pixels |
| Aspect ratio | 20:9 | 19.5:9 | Xiaomi 15 is taller |
| Visible height, portrait, with browser bars | ~794 px | ~684 px | +110 px for the Xiaomi 15 |
| Landscape width (CSS px) | 890 px | 874 px | +16 px for the Xiaomi 15 |
| Visible height, landscape | ~320 px | ~352 px | −32 px for the Xiaomi 15 |
| First released | 2023 | 2024 | 1 year apart |
| Engine in MobileCheck | Chromium (Chrome) | WebKit (Safari) | different engines |
CSS px are the units media queries see. Visible heights subtract the status bar and the Chrome on Android and Safari on iOS bars as set in our device profiles; real bar heights vary with settings and scrolling. The release year is that of the first model with each screen.
What this means for your layout
How the width difference affects your layout
The iPhone 17 is 2 CSS px wider (402 vs 400, 1% more). No common breakpoint falls between 400 and 402 px, so with typical media queries both get the same layout and the extra 2 pixels only stretch fluid columns, text lines and images.
In a 2-column card grid with 16 px page padding and 16 px gaps, each card is 177 px wide on the iPhone 17 and 176 px on the Xiaomi 15. Check that buttons, prices and long words still fit in the narrower one.
Pixel density and image sizes
Both draw each CSS pixel with 3 × 3 device pixels, so text and icons are equally sharp. A full-width image (sizes="100vw") needs about 1200 px on the Xiaomi 15 and 1206 px on the iPhone 17 to look sharp.
With a srcset such as 640w, 828w, 1080w, 1290w, 1440w, 1640w, 2048w, the browser would normally pick the 1290w file on the Xiaomi 15 and the same one on the iPhone 17.
Above 2× most people can't see much difference in photos, so capping photo candidates around twice the CSS width saves bytes on both. Keep SVG for icons and logos: they stay sharp at any ratio.
How much fits above the fold
On first load about 794 px of the page is visible on the Xiaomi 15 and 684 px on the iPhone 17: 110 px less (16%) on the iPhone 17, roughly 4 lines of 16 px body text at a 1.5 line height.
If your main button sits just above the fold on the Xiaomi 15, it can end up below it on the iPhone 17. Keep the headline and the main action within the first 684 px, and size full-screen sections with 100svh rather than 100vh — see the 100vh problem on mobile.
Relative to its width, the Xiaomi 15 has the taller screen (20:9 vs 19.5:9), so the same content is laid out narrower but more of its length fits at once.
In landscape
Turned sideways, the Xiaomi 15 is 890 px wide and the iPhone 17 874 px. The visible height drops to about 320 and 352 px, so a 64 px sticky header covers 20% and 18% of the screen — under the 25% at which MobileCheck flags fixed bars covering the page.
Different browser engines
The iPhone 17 renders with WebKit (Safari's engine) and the Xiaomi 15 with Chromium (Chrome's), so fonts, form controls and some CSS can differ on top of the size difference. Chrome DevTools draws every emulated device with Chromium, which hides WebKit-only problems — see how to test on an iPhone and on Android.
More about these devices
- Xiaomi 15 viewport size — one screen for the Xiaomi 14 / 15
- iPhone 17 viewport size — one screen for the iPhone 16 Pro / 17 / 17 Pro
Or open the free check with the Xiaomi 15 and the iPhone 17 preselected: full-page screenshots in WebKit and Chromium, with problems such as small text and crowded buttons highlighted.
Related comparisons
- iPhone 16 Pro vs Galaxy S24 Ultra — 402 vs 384 px wide, 3× vs 2.813×
- iPhone 17 vs Galaxy S25 — 402 vs 360 px wide, 3× vs 3×
- iPhone 17 vs Pixel 9 — 402 vs 412 px wide, 3× vs 2.625×
- iPhone 17 Pro vs Pixel 9 Pro — 402 vs 427 px wide, 3× vs 3×
- Galaxy Z Flip 6 vs iPhone 16 Pro — 360 vs 402 px wide, 3× vs 3×
- iPhone 16 vs iPhone 17 — 393 vs 402 px wide, 3× vs 3×
Compare other devices → · All mobile viewport sizes →
Frequently asked questions
Is the Xiaomi 15 screen bigger than the iPhone 17?
In CSS pixels, which decide how much of a page fits, the Xiaomi 15 is larger: 400 × 890 against 402 × 874. The Xiaomi 15 has more physical pixels (1200 × 2670), which makes it sharper rather than roomier.
Do I need different CSS for the Xiaomi 15 and the iPhone 17?
Usually not. No common breakpoint falls between their widths (400 and 402 px), so a fluid layout gets the same rules on both and only stretches by 2 px.
How much of a web page is visible on the Xiaomi 15 vs the iPhone 17?
About 400 × 794 CSS px on the Xiaomi 15 and 402 × 684 on the iPhone 17 when a page first opens in portrait, after the status bar and the browser's bars. Bar heights are our device profiles' estimates.