Runs in your browser ยท nothing uploaded
  1. Home
  2. Guides
  3. How Websites Detect Your Device
Device

How Websites Detect Your Device

A practical guide to understanding how websites identify your device using user agents, feature detection, and viewport measurements.

By DeviceInfo Editorial Team October 18, 2026 4 min read

Illustration for the guide: How Websites Detect Your Device

Short answer

Website developers determine your device type by reading your browser's User Agent string and testing for specific technical features like touch support and WebGL capabilities. They combine these signals with your viewport dimensions to guess your screen size. No single method is perfect, so sites rely on a combination of these data points to build a reasonable picture of your hardware.

What the check does

When you load a page, the browser automatically sends a text string called the User Agent. This string contains the name of your browser, operating system, and sometimes your device model. Additionally, the website's code can run simple tests to see if your screen supports touch input, specific graphics features, or certain storage options. These checks are performed instantly in the background. They are not intended to spy on you but to ensure the site loads the correct images, scripts, and layouts for your specific environment.

How to read the result

Think of the detection process as a handshake. First, the browser states who it is (User Agent). Then, the website asks specific questions like "Do you have a touchscreen?" or "How wide is your screen?" You can verify these results by using a device information tool. If a website claims you are using an iPhone but detects no touch support, it may be a simulation or an extension altering your signals. Cross-referencing the User Agent with feature tests helps identify inconsistencies. If the data looks wrong, check if you are in private mode or using zoom, as these can sometimes alter default reporting.

What the values mean

SignalSourceMeaning
User AgentBrowser HeaderTextual declaration of OS and Browser version
Touch SupportFeature DetectionIndicates if the device has a touchscreen
Viewport WidthCSS Media QueriesDetermines layout breakpoints for responsive design
WebGLJavaScript APIConfirms hardware graphics capabilities
Device MemoryPerformance APIRough estimate of RAM for performance tuning

Common questions

  • Does the User Agent lie? Yes, users can modify it, and some browsers genericize it for privacy.
  • Is feature detection better? Often, because it tests what the browser can actually do rather than what it claims to be.
  • Do private mode change results? Sometimes. Private modes may restrict access to storage or hide previous session data.
  • Can extensions affect detection? Yes. Ad blockers or privacy extensions can modify headers or block certain APIs.

Try it live

You can check your current signals by visiting our Device Information tool. It will display your live User Agent string and detected features so you can compare them against your physical hardware.

Limitations

Browsers are increasingly withholding specific hardware details to protect user privacy. For example, the exact device model is often replaced with a generic "WebKit" string on many modern mobile browsers. Furthermore, browsers may report maximum memory values instead of current usage, and WebRTC APIs can be filtered to prevent IP address leaks. Therefore, any tool or website claiming to identify your exact phone model with 100% certainty should be viewed with skepticism. The web platform is designed to be generic by default to ensure safety and compatibility across diverse environments.

Frequently asked questions

How accurate is device detection?

It is usually accurate for major device categories like desktop versus mobile. However, specific model identification is difficult because many devices send generic strings. Feature detection is more reliable than string matching for confirming capabilities.

Do websites track me with this data?

Not inherently. Reading the User Agent and viewport is standard for web development. It becomes tracking only if this data is combined with persistent identifiers to follow you across different websites without consent.

Why does my desktop look like a mobile?

This often happens if you have narrow windows, high browser zoom, or extensions forcing a mobile user agent. Check your window width and disable temporary overrides to see the true desktop signal.

What is the difference between UA and feature detection?

User Agent is a label sent by the browser. Feature detection is a code-based test that asks the browser for specific abilities. Feature detection is generally considered more robust because it verifies actual support rather than relying on a text string.

Your device, your values

See this on your own browser right now

Keep reading