Skip to content
1440px

iPhone 4 Screen Size

CSS viewport, native resolution, pixel ratio and safe area for the iPhone 4 — the numbers you need to design and build for it.

CSS viewport · portrait
320 × 480 px

Native resolution 640 × 960 px at 2× · 326 PPI · 3.5″ · 2:3. Design at 320 × 480 and export assets at 2×.

iPhone 4 display specifications
PropertyValue
CSS viewport (portrait)320 × 480 px
CSS viewport (landscape)480 × 320 px
Native resolution640 × 960 px
Device pixel ratio
Pixel density326 PPI
Screen diagonal3.5 in
Panel size1.96 × 2.94 in
Aspect ratio2:3
Total pixels0.61 MP
Released2010
Operating systemiOS
Safe area (top / bottom)20 / 0 px

Among the 130 phones on this site, the iPhone 4 has the 130th largest CSS viewport area. Its 320 px width is 79 px below the 399 px average for this category.

Targeting the iPhone 4 in CSS

Device-specific media queries are brittle — a new model with the same width will not match. Use them for genuine per-device fixes only, and prefer width buckets for layout.

CSS media query
/* Target iPhone 4 specifically */
@media only screen
  and (device-width: 320px)
  and (device-height: 480px)
  and (-webkit-device-pixel-ratio: 2) {
  /* … */
}

/* More useful in practice — the width bucket it falls into */
@media (min-width: 320px) { /* … */ }

Safe area on the iPhone 4

Home button, status bar only. Content placed inside the top 20 px or the bottom 0 px will sit under system UI unless you inset it.

Safe area insets
/* iPhone 4 safe area — requires viewport-fit=cover */
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">

.app {
  padding-top:    env(safe-area-inset-top);    /* 20px */
  padding-bottom: env(safe-area-inset-bottom); /* 0px */
  padding-left:   env(safe-area-inset-left);
  padding-right:  env(safe-area-inset-right);
}

Compare with other iPhone models

iPhone 4 compared with nearby iPhone models
DeviceCSS viewportNativeDPRPPIDiagonal
iPhone 4320 × 480640 × 9603263.5″
iPhone 4s320 × 480640 × 9603263.5″
iPhone 5320 × 568640 × 11363264″
iPhone 5s320 × 568640 × 11363264″
iPhone 5c320 × 568640 × 11363264″
iPhone 6375 × 667750 × 13343264.7″
iPhone 6 Plus414 × 7361080 × 19204015.5″
iPhone 6s375 × 667750 × 13343264.7″
iPhone 6s Plus414 × 7361080 × 19204015.5″

Questions about the iPhone 4 screen

What is the screen size of the iPhone 4?

The iPhone 4 has a 3.5-inch display. In CSS the viewport measures 320 × 480 px in portrait, and the panel itself has 640 × 960 physical pixels at 326 PPI.

What resolution should I design for on the iPhone 4?

Design at 320 × 480 and export assets at . That gives you 640 × 960 px images, which is exactly what the panel renders. Designing directly at 640 × 960 means every measurement is 2 times larger than the CSS values you will write.

What is the device pixel ratio of the iPhone 4?

The iPhone 4 reports a device pixel ratio of 2. One CSS pixel therefore covers 4 device pixels. You can read it in JavaScript with window.devicePixelRatio.

What are the safe area insets on the iPhone 4?

In portrait the safe area inset is 20 px at the top and 0 px at the bottom (Home button, status bar only). Use env(safe-area-inset-*) rather than hard-coding these — the values change per device and per orientation.

Which other devices have the same viewport as the iPhone 4?

1 other device shares the 320 × 480 CSS viewport: iPhone 4s. A layout that works on one works on all of them.

Related

Specifications from the manufacturer's published device data. Last verified 7 August 2026. CSS viewport values are the portrait window.innerWidth/innerHeight reported by the stock browser with no browser chrome. See methodology and sources.