# What makes a page think it is a phone?

> Window width, mobile mode, user agent, pixel density: a lab notebook toggles each one alone, then together, and records which of ten tests says phone.

Lab notebook by Serghei Pogor, founder of CurlShot (https://curlshot.com/about/serghei-pogor). Published 2 December 2026. Page for people: https://curlshot.com/blog/what-makes-a-page-think-it-is-a-phone

A page decides it is on a phone from four separate settings, and each one moves its own tests. Window width moves the CSS width tests. Mobile mode moves touch, pointer, hover and the client hint. The user agent string moves only server-side and script sniffing. Pixel density moves srcset and resolution. In a grid of all 16 combinations run through the CurlShot renderer, each of 10 tests followed exactly one of them when the page had a viewport tag, and only all four together gave 10 of 10, the same answers as the iphone_15_pro preset.

## Key facts

- Width alone moved 3 of 10 tests, mobile mode alone 4, the user agent alone 1, pixel density alone 2. Each test followed one setting.
- A phone user agent on a 1280 px window made 1 test of 10 say phone, and the client hint still said desktop. The string is for sniffing, not for layout.
- Mobile mode at 1280 px made 4 tests say phone (pointer, hover, touch, client hint) and left the layout 1280 px wide. It is an input setting, not a size setting.
- All four together gave 10 of 10, identical to the iphone_15_pro preset: a preset is these settings bundled.
- Without a viewport tag, mobile mode at 390 px lays the page out 980 px wide, so the width query stops matching. The screenshot is still 390 px wide.
- Pixel density never says phone: density 3 on a desktop window picked the 3x picture and made a 3840 x 2532 image.

## The question
CurlShot can open a page as a computer or as a phone. A page decides which it is looking at with several different tests. This notebook changes one setting at a time and writes down which tests answer.
## The result in one grid
All 16 combinations of the four settings, on a page with a viewport tag. "phone" means the test says phone. Layout px is the width the page was laid out at.
| Width | Mobile | UA | Density | max-width | device-width | picture | coarse | hover | touch | hint | UA string | 2dppx | srcset | Layout px | Image px |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 1280 | off | desktop | 1x | - | - | - | - | - | - | - | - | - | - | 1280 | 1280 x 844 |
| 1280 | off | desktop | 3x | - | - | - | - | - | - | - | - | phone | phone | 1280 | 3840 x 2532 |
| 1280 | off | iPhone | 1x | - | - | - | - | - | - | - | phone | - | - | 1280 | 1280 x 844 |
| 1280 | off | iPhone | 3x | - | - | - | - | - | - | - | phone | phone | phone | 1280 | 3840 x 2532 |
| 1280 | on | desktop | 1x | - | - | - | phone | phone | phone | phone | - | - | - | 1280 | 1280 x 844 |
| 1280 | on | desktop | 3x | - | - | - | phone | phone | phone | phone | - | phone | phone | 1280 | 3840 x 2532 |
| 1280 | on | iPhone | 1x | - | - | - | phone | phone | phone | phone | phone | - | - | 1280 | 1280 x 844 |
| 1280 | on | iPhone | 3x | - | - | - | phone | phone | phone | phone | phone | phone | phone | 1280 | 3840 x 2532 |
| 390 | off | desktop | 1x | phone | phone | phone | - | - | - | - | - | - | - | 390 | 390 x 844 |
| 390 | off | desktop | 3x | phone | phone | phone | - | - | - | - | - | phone | phone | 390 | 1170 x 2532 |
| 390 | off | iPhone | 1x | phone | phone | phone | - | - | - | - | phone | - | - | 390 | 390 x 844 |
| 390 | off | iPhone | 3x | phone | phone | phone | - | - | - | - | phone | phone | phone | 390 | 1170 x 2532 |
| 390 | on | desktop | 1x | phone | phone | phone | phone | phone | phone | phone | - | - | - | 390 | 390 x 844 |
| 390 | on | desktop | 3x | phone | phone | phone | phone | phone | phone | phone | - | phone | phone | 390 | 1170 x 2532 |
| 390 | on | iPhone | 1x | phone | phone | phone | phone | phone | phone | phone | phone | - | - | 390 | 390 x 844 |
| 390 | on | iPhone | 3x | phone | phone | phone | phone | phone | phone | phone | phone | phone | phone | 390 | 1170 x 2532 |
- **max-width**: CSS width query, read as @media (max-width: 600px); says phone when matches.
- **device-width**: CSS device-width query, read as @media (max-device-width: 600px); says phone when matches.
- **picture**: picture source by width, read as <source media="(max-width: 600px)">; says phone when narrow source chosen.
- **coarse**: Pointer query, read as @media (pointer: coarse); says phone when matches.
- **hover**: Hover query, read as @media (hover: none); says phone when matches.
- **touch**: Touch points, read as navigator.maxTouchPoints > 0; says phone when above 0.
- **hint**: Client hint, read as navigator.userAgentData.mobile and the Sec-CH-UA-Mobile header; says phone when true, ?1.
- **UA string**: User agent sniff, read as /Mobi/.test(navigator.userAgent), and the same test on the request header; says phone when finds "Mobi".
- **2dppx**: Resolution query, read as @media (min-resolution: 2dppx); says phone when matches.
- **srcset**: srcset pick, read as img srcset="1x, 2x, 3x" and currentSrc; says phone when 2x or 3x chosen.
## Which setting each test follows
| Setting | Request option | Tests that changed with it |
| --- | --- | --- |
| Window width | viewport_width | max-width, device-width, picture |
| Mobile mode | viewport_mobile | coarse, hover, touch, hint |
| User agent | user_agent | UA string |
| Pixel density | device_scale_factor | 2dppx, srcset |
## The notebook
### Entry 1: Baseline: a desktop browser
- Question: What does the page say before anything is changed?
- Run: Window 1280 x 844, desktop user agent, density 1, mobile mode off, page with a viewport tag.
- Saw: 0 of 10 tests said phone. The srcset picked the 1x file and the picture element took its wide source. The page was served as a desktop page.
- Note: Every later entry changes one thing from this line.
### Entry 2: Only the width: 390 px
- Question: Is a narrow window enough to make a page think it is a phone?
- Run: viewport_width=390. Nothing else changed.
- Saw: 3 of 10 said phone: max-width, device-width, picture. The pointer was still fine, hover still worked, no touch points, the client hint said ?0 and the user agent was the desktop one.
- Note: A responsive stylesheet is satisfied by width alone. Anything that asks about touch, pointer or the browser name still sees a desktop with a small window.
### Entry 3: Only mobile mode, at 1280 px
- Question: Does mobile mode change the width?
- Run: viewport_mobile=true on the 1280 px window.
- Saw: 4 of 10 said phone: coarse, hover, touch, hint. The layout was still 1280 px wide, so none of the width tests moved, and the user agent string was still the desktop one. The request carried Sec-CH-UA-Mobile: ?1. The image was 1280 x 844.
- Note: Mobile mode is the input setting, not the size setting. It is the only one that touches the touch, pointer, hover and client-hint tests.
### Entry 4: Only the user agent: iPhone Safari
- Question: Does a phone user agent make the page lay out like a phone?
- Run: user_agent set to the iPhone string of the iphone_15_pro preset, window still 1280 px, mobile mode off.
- Saw: 1 of 10 said phone: the user agent test. The server saw an iPhone and served its phone page. Every CSS test, the touch test and the density tests stayed desktop, and the client hint said ?0, so the string and the hint disagreed.
- Note: Only a server or a script that reads the user agent follows this setting. The renderer source says it aligns the client hints only for its own default string and leaves a user agent you send exactly as sent, so the hint stays at desktop.
### Entry 5: Only the pixel density: 3
- Question: Is a dense screen a sign of a phone?
- Run: device_scale_factor=3 on the 1280 px window.
- Saw: 2 of 10 said phone, both about density: the resolution query and the srcset pick (the 3x file). Nothing about size, input or the browser name moved. The image was 3840 x 2532, three times wider than the window.
- Note: Density says how sharp the picture is, not what kind of device it is. The laptop presets use density 2 as well.
### Entry 6: All four together, and the preset
- Question: What is a device preset, in these terms?
- Run: Width 390, mobile on, iPhone user agent, density 3. Then the iphone_15_pro preset alone.
- Saw: 10 of 10 said phone for the four switches, and 10 of 10 for the preset, with the same answer on every test. The four-switch image was 1170 x 2532; the preset is 393 px wide, so its image is 1179 x 2556.
- Note: A preset is these four settings set together, with its own touch flag. Send one of them yourself and it wins over the preset.
### Entry 7: All 16 combinations, with a viewport tag
- Question: Do the settings interfere with each other?
- Run: Every combination of the four settings: 2 x 2 x 2 x 2 = 16 runs, on a page with a viewport tag.
- Saw: No. Each of the 10 tests followed exactly one setting in all 8 pairs of runs that differ in that setting. Width moved 3 tests, mobile mode 4, the user agent 1, density 2: 10 in all, none counted twice.
- Note: The grid below is the whole result. Read a column to see which setting a test listens to.
### Entry 8: Take the viewport tag away
- Question: What if the page has no viewport meta tag?
- Run: The same 16 runs on a page without <meta name="viewport">. Then 390 px wide with mobile mode on, the case that went wrong.
- Saw: With mobile mode on, a 390 px window laid the page out 980 px wide, the width a phone browser falls back to for a page without a viewport tag. The width query and the picture source stopped matching, so 5 of 10 said phone instead of 7. The image was still 390 px wide: the page was drawn 980 px wide and shrunk to fit. Mobile mode off at 390 px behaved as before (layout 390 px). These two tests, max-width and picture, were the only ones that followed a second setting.
- Note: Without a viewport tag, width and mobile mode stop being independent. A screenshot of a tag-less page in mobile mode shows a small desktop page, not a phone layout.
### Entry 9: Reading the width in a script
- Question: Is window.innerWidth the same as the CSS width?
- Run: A 900 px wide element added to the page, window 390 px, with and without mobile mode.
- Saw: With mobile mode off, innerWidth was 390. With mobile mode on it was 916, while the layout width stayed 390 and the CSS width query still matched. Without the viewport tag it was 980.
- Note: A script that tests innerWidth < 600 can disagree with the stylesheet in mobile mode: here it read 916 and called the window wide while the CSS called it narrow.
## The same 16 runs without a viewport tag
Layout px shows the 980 px fallback when mobile mode is on.
| Width | Mobile | UA | Density | max-width | device-width | picture | coarse | hover | touch | hint | UA string | 2dppx | srcset | Layout px | Image px |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 1280 | off | desktop | 1x | - | - | - | - | - | - | - | - | - | - | 1280 | 1280 x 844 |
| 1280 | off | desktop | 3x | - | - | - | - | - | - | - | - | phone | phone | 1280 | 3840 x 2532 |
| 1280 | off | iPhone | 1x | - | - | - | - | - | - | - | phone | - | - | 1280 | 1280 x 844 |
| 1280 | off | iPhone | 3x | - | - | - | - | - | - | - | phone | phone | phone | 1280 | 3840 x 2532 |
| 1280 | on | desktop | 1x | - | - | - | phone | phone | phone | phone | - | - | - | 1280 | 1280 x 844 |
| 1280 | on | desktop | 3x | - | - | - | phone | phone | phone | phone | - | phone | phone | 1280 | 3840 x 2532 |
| 1280 | on | iPhone | 1x | - | - | - | phone | phone | phone | phone | phone | - | - | 1280 | 1280 x 844 |
| 1280 | on | iPhone | 3x | - | - | - | phone | phone | phone | phone | phone | phone | phone | 1280 | 3840 x 2532 |
| 390 | off | desktop | 1x | phone | phone | phone | - | - | - | - | - | - | - | 390 | 390 x 844 |
| 390 | off | desktop | 3x | phone | phone | phone | - | - | - | - | - | phone | phone | 390 | 1170 x 2532 |
| 390 | off | iPhone | 1x | phone | phone | phone | - | - | - | - | phone | - | - | 390 | 390 x 844 |
| 390 | off | iPhone | 3x | phone | phone | phone | - | - | - | - | phone | phone | phone | 390 | 1170 x 2532 |
| 390 | on | desktop | 1x | - | phone | - | phone | phone | phone | phone | - | - | - | 980 | 390 x 844 |
| 390 | on | desktop | 3x | - | phone | - | phone | phone | phone | phone | - | phone | phone | 980 | 1170 x 2531 |
| 390 | on | iPhone | 1x | - | phone | - | phone | phone | phone | phone | phone | - | - | 980 | 390 x 844 |
| 390 | on | iPhone | 3x | - | phone | - | phone | phone | phone | phone | phone | phone | phone | 980 | 1170 x 2531 |
## Presets and overrides
Tests saying phone, out of 10, with a viewport tag.
| Request options | Tests saying phone | Tests not saying phone | Image px | Note |
| --- | --- | --- | --- | --- |
| viewport_device=iphone_15_pro | 10 of 10 | none | 1179 x 2556 | The preset alone. |
| viewport_device=pixel_8 | 10 of 10 | none | 1082 x 2402 | Density 2.625 picked the 3x file: the next size up. |
| viewport_device=ipad | 7 of 10 | max-width, device-width, picture | 1640 x 2360 | Width 820 passes none of the size tests. The iPad user agent still contains "Mobile". |
| viewport_device=galaxy_tab_s9 | 6 of 10 | max-width, device-width, picture, UA string | 1600 x 2560 | Its user agent has "Android" but not "Mobile", so a /Mobi/ sniff calls it a computer. |
| viewport_device=iphone_15_pro&viewport_mobile=false | 9 of 10 | hint | 1179 x 2556 | Touch stays on: a preset keeps its own touch setting. Only the client hint turns off. |
| viewport_device=iphone_15_pro&user_agent=<desktop Chrome> | 9 of 10 | UA string | 1179 x 2556 | Only the user agent test changes. The client hint still says mobile. |
| viewport_device=iphone_15_pro&viewport_width=1280 | 7 of 10 | max-width, device-width, picture | 3840 x 2556 | The three size tests turn off; everything else stays. |
| viewport_device=iphone_15_pro&device_scale_factor=1 | 8 of 10 | 2dppx, srcset | 393 x 852 | The two density tests turn off; the file is 393 px wide. |
| viewport_device=iphone_15_pro&viewport_landscape=true | 7 of 10 | max-width, device-width, picture | 2556 x 1179 | Turned on its side the window is 852 px wide, so the size tests turn off. |
## Which option to reach for
| You want | Option | Why |
| --- | --- | --- |
| The responsive layout of a phone-width page | viewport_width | Width queries and picture sources follow the width and nothing else. |
| Taps, no hover, a coarse pointer, touch events | viewport_mobile | It is the only setting that turns on touch, coarse pointer, hover: none and the mobile client hint. |
| The page a server sends to phones | user_agent | Server-side sniffing reads the string. Pair it with mobile mode if the page also looks at the client hint. |
| A sharper picture, the 2x or 3x image | device_scale_factor | It decides the srcset file and the picture size, and tells the page nothing about being a phone. |
| All of it at once, as one named device | viewport_device | A preset sets width, height, density, mobile mode, touch and user agent. Add one option of your own to override that part. |
## How it was run
On 12 November 2026. The capture renderer of this product was started from the repository with a stand-in secret and pointed at a small server on this machine. A test page asked the browser ten questions about itself (the CSS media queries, the touch API, the client hint, the user agent string, which picture it chose) and the server logged the request headers. Every setting was rendered twice, in two passes; the two passes agreed in every one of the 49 settings. Chromium 153.0.8010.12 through Playwright 1.63.0, on a Linux server that was busy with other work, so no timings are reported; the numbers are counts and pixel sizes. No call to the API was sent. These are 10 tests chosen for this notebook; a real site may ask others, and a real phone is not Chromium emulation.

## Questions

### Does changing the user agent give me the mobile layout of a site?

Only if the site picks its layout on the server or in a script that reads the user agent string. CSS width queries do not read it. In the lab, an iPhone user agent on a 1280 px window changed 1 of 10 tests and left every width, touch and density test where it was. Add a phone width or a preset to get the layout of a responsive site.

### Is a narrow window enough to screenshot the mobile version of a page?

For a responsive stylesheet, yes: a 390 px window flipped 3 size tests. A page that also checks touch, pointer or the client hint still sees a desktop. Use mobile mode or a preset (CurlShot option viewport_device) when the page cares about input.

### Why does my mobile screenshot show a shrunken desktop page?

The page has no viewport meta tag. With mobile mode on, the browser lays such a page out 980 px wide and scales it to the window, so the image is phone-sized but the page is a small desktop page. With mobile mode off the same window lays out at its real width. This is how a phone treats that page too.

### How do I turn touch on in a capture?

Set viewport_mobile=true, or use a device preset. There is no separate touch option: mobile mode turns touch on for a custom size, and a preset sets its own touch flag, which stayed on in the lab when mobile mode was switched off for the iphone_15_pro preset.

### Why does my phone capture have more pixels than the window?

That is pixel density. A 393 px window at density 3 gives a 1179 px image of the same layout. Density does not change what the page thinks the device is; it only chooses the 2x or 3x pictures and sharpens the text.

## Sources

1. Playwright, "Browser.newContext: isMobile, hasTouch and the other context options": https://playwright.dev/docs/api/class-browser#browser-new-context (checked 12 November 2026)
2. MDN Web Docs, "pointer: the CSS media feature (none, coarse, fine)": https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pointer (checked 12 November 2026)
3. MDN Web Docs, "Sec-CH-UA-Mobile request header": https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-CH-UA-Mobile (checked 12 November 2026)
4. MDN Web Docs, "The img element: srcset and density descriptors": https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/img (checked 12 November 2026)

## Go deeper

- [Mobile screenshot tool](https://curlshot.com/tools/mobile-screenshot)
- [Tablet screenshot tool](https://curlshot.com/tools/tablet-screenshot)
- [Devices and presets](https://curlshot.com/docs/devices)
- [Mobile mode and emulation](https://curlshot.com/docs/dark-mode-and-emulation)
- [Pricing](https://curlshot.com/pricing)

## Read next

- [Viewport sizes cheat sheet: phones to desktops](https://curlshot.com/blog/viewport-sizes-cheat-sheet.md): Viewport sizes in CSS pixels, screenshot sizes and device pixel ratios of iPhone, Pixel, Galaxy, iPad and laptop screens, drawn to scale, and the sizes to test.
- [Full-page screenshot on every device and browser](https://curlshot.com/blog/full-page-screenshot-every-device.md): Exact keys and menu names to screenshot a whole web page in Chrome, Firefox, Edge, Safari, iPhone, iPad and Android, checked against each vendor.
- [Why website screenshots look wrong, and the fixes](https://curlshot.com/blog/why-website-screenshots-look-wrong.md): A field guide to 11 ways a website screenshot goes wrong, from blank lazy images to cookie banners and cut-off pages, with the cause and the fix for each.
- [How to screenshot a website in dark mode](https://curlshot.com/blog/dark-mode-screenshots.md): How to capture any site in dark or light mode, the three ways a site switches its theme, why a page ignores your dark setting, and the fix for each case.
