MobileCheck

CSS Media Query Generator for Phones and Tablets

Pick phones and tablets or enter your breakpoints, and copy ready-made CSS media queries in both the modern range syntax and classic min-width/max-width — with breakpoints suggested from 51 real device widths.

1. Media queries for the devices you pick

Choose individual devices (40 of 51 selected)
iPhone
Android
Tablets

40 devices · widths 344–440 px · pixel ratio 2–4

Range syntax (modern browsers)

/* Portrait */
@media (344px <= width <= 440px) and (orientation: portrait) {
  /* … */
}

min-width / max-width (every browser)

/* Portrait */
@media (min-width: 344px) and (max-width: 440px) and (orientation: portrait) {
  /* … */
}

2. Breakpoints suggested from 51 real devices

LayoutWidthsDevices
under 576 px344–440 px40: iPhone 7, iPhone 7 Plus, iPhone 8, iPhone 8 Plus, iPhone X, iPhone XR and 34 more
576 px to under 900 px690–834 px9: iPad 7–9 (10.2"), iPad 10 / Air 4–5 (10.9"), iPad mini 6 / 7, iPad Pro 11", Galaxy Tab S7 / S8 / S9, Galaxy Tab A7 / A8 / A9+ and 3 more
900 px and wider1024–1032 px2: iPad Pro 12.9", iPad Pro 13" (M4)

Mobile-first queries, range syntax

/* under 576 px */
@media (width < 576px) {
  /* … */
}

/* 576 px to under 900 px */
@media (576px <= width < 900px) {
  /* … */
}

/* 900 px and wider */
@media (width >= 900px) {
  /* … */
}

Same, with min-width / max-width

/* under 576 px */
@media (max-width: 575.98px) {
  /* … */
}

/* 576 px to under 900 px */
@media (min-width: 576px) and (max-width: 899.98px) {
  /* … */
}

/* 900 px and wider */
@media (min-width: 900px) {
  /* … */
}

How to use the generated queries

Write the base styles for the narrowest screen first, then let each breakpoint add layout as space appears — that is the "mobile-first" block in part 2. Device-picked queries from part 1 are best for testing and targeted fixes ("the header wraps on 360 px Androids"), not for building a layout per phone: phone widths cluster between 344 and 440 px, many models share a width, and new ones appear every year. The full list with each model's size is on the mobile viewport sizes page.

Range syntax or min-width / max-width?

Media Queries Level 4 range syntax — (width >= 600px), (600px <= width < 900px) — reads like maths and has no gaps: a band ending at < 900px and the next starting at >= 900px cover every width, even fractional ones at odd zoom levels. It works in Chrome and Edge 104+, Safari 16.4+ and Firefox 63+. The classic min-width/max-width form works everywhere; because both ends are inclusive, the generator ends each band at .98 (max-width: 899.98px) so no width matches two bands.

Orientation and pixel ratio

orientation: landscape simply means the viewport is wider than it is tall. That also happens on Android when the on-screen keyboard opens and shrinks the viewport, so a phone held upright can suddenly match a landscape query. Base layouts on width, and use orientation only for things like full-screen media. min-resolution (with -webkit-min-device-pixel-ratio for old Safari) matches high-density screens; for images, srcset and image-set() are usually the better tool.

How the suggested breakpoints are found

The tool sorts the distinct portrait widths of the devices and splits them at the widest gaps between neighbouring widths — natural breaks, where no device lives. Each breakpoint is placed inside a gap, on a common value such as 600 or 900 when one fits, so no real device sits right at an edge. Remember that the viewport meta tag is required for any of this: without it, phones report a 980 px wide viewport and your phone queries never match.

Frequently asked questions

Which media query targets all phones?

@media (width < 600px), or (max-width: 599.98px) in the older syntax. Every phone in our list of 51 devices is between 344 and 440 CSS px wide in portrait, while tablets start around 690 px.

Should I write media queries for specific iPhone models?

Rarely. Many models share a width (390, 393, 402 or 430 px), new ones arrive every year, and the visible height changes with the browser bars. Write fluid styles and add breakpoints where your layout starts to break.

Does max-width include the value itself?

Yes. max-width: 600px matches at exactly 600 px, as does min-width: 600px. Pair min-width: 600px with max-width: 599.98px, or use the range syntax (width < 600px), so no width matches both.

Is the range syntax (width >= 600px) safe to use?

Yes for current browsers: Chrome and Edge 104+, Safari 16.4+ and Firefox 63+ support it. If you must support older iPhones that cannot update past iOS 16.3, use min-width and max-width.

More free tools: color contrast checker · tap target size checker · mobile font size calculator · device mockup generator · all tools