How device detection works
The detected device type is how your browser presents itself to websites: as a desktop, mobile phone or tablet. Websites use it to choose a layout, size buttons for touch and suggest the right app or download.
How websites detect your device
Most device detection reads the user agent. Phones include a Mobile token, Android tablets usually leave it out, and desktop browsers report a desktop operating system. Chromium-based browsers also send a Sec-CH-UA-Mobile header that says directly whether the device is mobile.
Detection databases match these patterns against thousands of known devices, browsers and bots to decide on a type. Most report categories such as desktop, smartphone, tablet, smart TV, console, wearable and bot.
Responsive design vs. device detection
Modern websites mostly use responsive design: the same page adapts its layout to the screen width, regardless of the device. Device detection is still used where the screen size doesn’t tell the whole story:
- offering the iOS or Android version of an app
- serving smaller images and videos to phones on mobile networks
- adapting features for touch screens, TVs or game consoles
- analytics: knowing what share of visitors use phones
When the result looks wrong
- Desktop on a phone: “Request desktop site” is switched on.
- Mac on an iPad: expected, because iPadOS Safari identifies itself as macOS.
- Unknown or generic: an uncommon browser, a privacy extension, or a modified user agent.