Choosing best screen sizes for design

Base Screen Size

Summary

DeviceResolution
Android360x640 pixels or dp’s
IOS375x667 pixels

Design

UnitSubUse
Viewport/Density-Independent UnitsPrimary units used in design.
Android’s dpAndroid DIP used for design.
IOS pointsIOS DIP used for design.
PixelsShould be used sparingly for very specific, fixed-size elements, like thin borders.
DPI/PPIFor image assets (not layout)
Scalable Pixels (sp)Androidsp is used for font sizes to ensure they scale based on the user’s preferred text size settings.

Assets

  • You create image assets in different pixel dimensions (e.g., 1x, 2x, 3x) to match different device densities so they don’t appear blurry or pixelated when displayed.
  • i.e. When creating images, use different pixel densities (e.g., 1x, 2x, 3x) to ensure they look sharp across all devices.

Why use viewport

  • Device Density - Mobile devices have varying pixel densities (e.g., high-resolution screens have more pixels per inch).
  • Consistent Scaling - Using density-independent units like Android’s dp or iOS’s points ensures UI elements appear at a consistent physical size on different devices, regardless of their pixel density.
  • Responsive Design - The viewport controls how the app is displayed across different screen sizes, allowing the layout to scale and adapt responsively.
  • User Experience - This approach helps maintain clarity and prevent blurry or pixelated images by ensuring elements are the appropriate size for the display.

Notes

  • Start Small
    • By designing for the smallest common screen sizes first, you’ll create a design that can easily scale to fit larger screens.
  • Scale Assets
    • You’ll need to manually export images and other visual assets at higher resolutions (multipliers) for crisp, non-pixelated images on high-density displays.

Testing

Breakpoints

NameDeviceBreakpointse.g.Notes
Small (Budget)Mobile~360px, ~390px360x800, 390x844a common Android baseline
TabletTablet~768px, ~800px768x1024, 1280x800
Large TabletTablet~1200px1280x800

Specific

NameTypeResolutionNotes
Med (Mid-Range)Mobile1080x2400pxprevalent resolution for many devices
Large (High End)Mobile1440x3200pxa common QHD+ resolution

Notes

  1. Orientation
  • Always test each chosen screen size in both portrait and landscape orientations to ensure layouts adapt correctly.
  1. Density
  • Consider different screen densities (pixels per inch) in addition to resolution, as this affects how elements are displayed.

Theory

Density-Independent Pixels (DPs)

  • Use DPs in your designs to help UI elements maintain the same physical size across devices with different pixel densities.

  • DPs ensure UI elements appear to be the same physical size across devices with different screen densities by translating a single dp value into a different number of real pixels on each device.

  • In mobile design, this means developers use dp units for layouts and font sizes to create responsive apps that look consistent and sharp on both low- and high-resolution screens, providing a uniform visual experience for users.

    One dp is roughly equivalent to one physical pixel on a medium-density (baseline) screen with 160 dots per inch (dpi).

Concepts

Resolution

  • This refers to the total number of physical pixels on a screen, typically expressed as width x height (e.g., 1920x1080 pixels).
  • It represents the absolute pixel count of the display.

Viewport

  • The viewport is the visible area of the screen where content is rendered.
  • In web development, it can be controlled by the meta viewport tag and responsive design techniques.
  • For mobile apps, the viewport often refers to the effective pixel dimensions used for layout, which may be scaled down from the native resolution to ensure consistent sizing across devices with varying pixel densities.

DPI (Dots Per Inch) or PPI (Pixels Per Inch)

  • This measures the pixel density of a screen, indicating how many pixels are packed into a physical inch of the display.
  • A higher DPI/PPI means a sharper image because more pixels are present in the same physical space.

Summary

  • Resolution is a fixed characteristic of the hardware, while the viewport can be adjusted or scaled by the operating system or browser to provide a consistent user experience despite differences in resolution and DPI.
  • DPI/PPI describes the density of pixels, which influences the perceived sharpness, whereas resolution describes the total quantity of pixels.

Calculations

VariableCalculation
ResolutionThis is a given specification of the device’s screen and is not calculated in app design.
DPI/PPICalculated below
ViewportThe viewport size is typically determined by the operating system or browser to provide a consistent layout experience.

Notes on viewport

  • While not directly calculated by the app designer in the same way as DPI, designers work with “density-independent pixels” (dp or dip) in Android or “points” in iOS, which are units that scale according to the device’s DPI to maintain consistent visual sizes.
  • The actual viewport dimensions in pixels are then derived by the system based on these density-independent units and the device’s pixel density.

1. Find the Device’s DPI (Dots Per Inch)

  • Locate the screen’s DPI in the device specifications.
  • This is the number of physical pixels packed into an inch of the screen.
  • A 160 DPI screen is the baseline for Android, where 1 dp equals 1 physical pixel.

2. Calculate the Density Ratio

  • Divide the device’s DPI by the baseline of 160 DPI:

    Density Ratio = DPI / 160

  • eg. For a 424 DPI device, the ratio is

    424 / 160 = 2.65.

3. Convert Physical Pixels (px) to Device-Independent Pixels (dp)

  • Use the formula

    dp = px / (DPI / 160)

  • e.g. To convert 1080px to dp on a 424 DPI device

    dp = 1080px / 2.65 = 407.5 dp.

4. Calculate the diagonal resolution

  • To find the diagonal resolution in pixels, use the Pythagorean theorem: Code

    Diagonal Resolution = sqrt(Width_pixels^2 + Height_pixels^2)

5. To calculate the DPI (from the resolution)

DPI/PPI = (Diagonal Resolution in Pixels) / (Diagonal Screen Size in Inches)