Skip to content

Apple · iPhone · 2025

iPhone 17 Screen Size & CSS Viewport

Standard iPhone 17 screen dimensions for web developers: 402 × 874 CSS viewport pixels, 1206 × 2622 physical resolution, 3x pixel density.

CSS Viewport

402 × 874

Physical Pixels

1206 × 2622

Pixel Ratio (DPR)

3x (460 PPI)

Screen Size

6.3" (19.5:9)

Safe Area Insets

62px / 34px

Tailwind Prefix

Default (< 640px sm)

Scaled Viewport Preview
top 62px
402 × 874Portrait · 3x
bottom 34px

6.3-inch 120Hz display with Dynamic Island (62px top safe area) and 34px bottom inset.

Copy-paste CSS

iPhone 17 CSS media queries & safe areas

Use content-based responsive breakpoints first, and reach for these snippets when auditing device-specific edge cases.

Responsive max-width query

/* iPhone 17 Portrait (402x874, 3x) */
@media only screen and (max-width: 402px) {
  /* styles for iPhone 17 and narrower viewports */
}

Exact device & DPR query

/* Target iPhone 17 specifically (402px width, 3x DPR) */
@media only screen
  and (device-width: 402px)
  and (device-height: 874px)
  and (-webkit-min-device-pixel-ratio: 3) {
  /* device-specific overrides */
}

Safe-area inset helpers

/* iPhone 17 safe-area padding (top 62px, bottom 34px) */
.sticky-header {
  padding-top: env(safe-area-inset-top, 62px);
}
.sticky-footer {
  padding-bottom: env(safe-area-inset-bottom, 34px);
}

Frontend QA notes

What breaks most often on iPhone 17

Browser environment: iOS Safari (WebKit) · Mobile.

  • With the base iPhone moving up to 402px CSS width, still pair it with a 360px Android viewport so older/narrow devices never overflow.
  • Use 100dvh for full-screen drawers and onboarding screens to match Safari's dynamic chrome.
  • Test touch targets at 44 × 44 CSS pixels minimum per Apple HIG.

Side-by-side

Compare iPhone 17 with nearby devices

Check how viewport width and pixel ratio shift across adjacent models.

DeviceViewportPhysicalDPR
iPhone 17402 × 8741206 × 26223x
iPhone 17 Pro402 × 8741206 × 26223x
iPhone 17 Pro Max440 × 9561320 × 28683x
iPhone 16393 × 8521179 × 25563x
iPhone 15393 × 8521179 × 25563x

Test iPhone 17 + 50 devices side by side

Stop resizing Chrome DevTools one viewport at a time. Sizzy renders iPhone 17, narrow 360px Android, iPad, and desktop simultaneously with synced scrolling, unified console, and one-click device screenshots.

Questions

iPhone 17 viewport questions

  • The iPhone 17 CSS viewport size is 402 × 874 pixels in portrait (874 × 402 pixels in landscape).