What makes a page think it is a phone?
Four settings can say it: window width, mobile mode, user agent, pixel density. Turn them on one at a time and see which of ten tests answers. The first dial position is mobile mode alone, on a 1280 px window.
4 of 10
tests say phone.
- Page laid out at
- 1280 px
- Picture file
- 1x
- Image
- 1280 x 844
Size
- CSS width querydesktop
- CSS device-width querydesktop
- picture source by widthdesktop
Input
- Pointer queryphone
- Hover queryphone
- Touch pointsphone
- Client hintphone
User agent
- User agent sniffdesktop
Density
- Resolution querydesktop
- srcset pickdesktop
The notebook, entry by entry
Each entry changes one thing from the first line and writes down what ten tests said. The tests are the ones a page can run on itself: three about size, four about input, one about the browser name, two about density. The dials above replay every entry. The real option names come from the CurlShot request, and the page was opened by the CurlShot renderer itself.[1]
Entry 1Baseline: a desktop browser
0 of 10 say phone
- 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.
- So
- Every later entry changes one thing from this line.
Entry 2Only the width: 390 px
3 of 10 say phone
- 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.
- So
- 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 3Only mobile mode, at 1280 px
4 of 10 say phone
- 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.
- So
- 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 4Only the user agent: iPhone Safari
1 of 10 say phone
- 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.
- So
- 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 5Only the pixel density: 3
2 of 10 say phone
- 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.
- So
- Density says how sharp the picture is, not what kind of device it is. The laptop presets use density 2 as well.
Entry 6All four together, and the preset
10 of 10 say phone
- 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.
- So
- 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 7All 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.
- So
- The grid below is the whole result. Read a column to see which setting a test listens to.
All 16 settings, one grid
Every row is one run on a page with a viewport tag. "phone" means the test says phone. Read a column and one setting explains it: the size tests turn on with the width, the input tests with mobile mode, the user agent test with the string, the density tests with the density. The two layout columns come from the same runs.
| Settings | Size | Input | User agent | Density | Result | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Width | Mobile | UA | Dens. | 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 |
Which setting moves which tests
Window width viewport_width
3 of 10: max-width, device-width, picture
Mobile mode viewport_mobile
4 of 10: coarse, hover, touch, hint
User agent user_agent
1 of 10: UA string
Pixel density device_scale_factor
2 of 10: 2dppx, srcset
What each test reads
CSS width query
@media (max-width: 600px)
CSS device-width query
@media (max-device-width: 600px)
picture source by width
<source media="(max-width: 600px)">
Pointer query
@media (pointer: coarse)
Hover query
@media (hover: none)
Touch points
navigator.maxTouchPoints > 0
Client hint
navigator.userAgentData.mobile and the Sec-CH-UA-Mobile header
User agent sniff
/Mobi/.test(navigator.userAgent), and the same test on the request header
Resolution query
@media (min-resolution: 2dppx)
srcset pick
img srcset="1x, 2x, 3x" and currentSrc
The hint column is the client hint a server receives as Sec-CH-UA-Mobile and a script reads as navigator.userAgentData.mobile; it says whether the browser is on a mobile device.[3] The coarse column is the pointer query: a finger counts as coarse, a mouse as fine.[2] The srcset column is the picture the browser chose from 1x, 2x, 3x: with density 2.625 it took the 3x file, the next size up.[4]
Where the settings meet
The grid says the settings do not interfere. Two more entries are where it stops being true.
Entry 8Take 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.
- So
- 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.
The same 16 settings on a page with no viewport tag
With mobile mode on and a 390 px window, the layout column reads 980, and the width, picture and max-width cells turn back to a dash.
| Settings | Size | Input | User agent | Density | Result | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Width | Mobile | UA | Dens. | 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 |
Entry 9Reading 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.
- So
- 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.
Presets and overrides
A device preset sets all four, and any option you send wins over it. These nine runs use viewport_device, on a page with a viewport tag. The iPad is not a phone by width and is one by user agent; the Galaxy Tab is the other way round.
| Request options | Say phone | Do not | Image | What it shows |
|---|---|---|---|---|
| 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
Pick by what the page checks, not by what a phone is. When you do not know, the preset sets everything the notebook moved.
| 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. |
curl "https://curlshot.com/api/v1/screenshot?access_key=YOUR_ACCESS_KEY&url=https://example.com&viewport_device=iphone_15_pro" \
--output phone.pngcurl "https://curlshot.com/api/v1/screenshot?access_key=YOUR_ACCESS_KEY&url=https://example.com&viewport_width=1280&viewport_mobile=true" \
--output desktop-size-touch.pngPresets and every option above are in Devices and Dark mode and emulation. Both the mobile screenshot tool and the tablet screenshot tool run a preset for you, and a successful render counts as one screenshot of the free plan whatever the device; see pricing.
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 the page reports counts and pixel sizes and no timings. No call to the API was sent: the renderer process of CurlShot was started from its source and given each request directly. The test pages are mine and small. A real site asks other questions, and a real phone is not Chromium with these settings switched on: this shows what the settings do, not what every site does.
The window was 844 px tall in every run (the product default is 1024); the iPhone user agent is the string of the iphone_15_pro preset, and the lab check found it identical to the string the preset sends. Four extra runs of a 900 px wide element produced the numbers of entry 9.
Related reading
Questions people ask
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. Checked .
- [2]MDN Web Docs, pointer: the CSS media feature (none, coarse, fine). Checked .
- [3]MDN Web Docs, Sec-CH-UA-Mobile request header. Checked .
- [4]MDN Web Docs, The img element: srcset and density descriptors. Checked .
Read next
- Cheat sheetViewport sizes cheat sheet: phones to desktopsViewport 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.
- How-toFull-page screenshot on every device and browserExact keys and menu names to screenshot a whole web page in Chrome, Firefox, Edge, Safari, iPhone, iPad and Android, checked against each vendor.
- Field guideWhy website screenshots look wrong, and the fixesA 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.
- ExplainerHow to screenshot a website in dark modeHow 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.