Sign up below to view device data and get your trial account.

We communicate via email to process your request in line with our privacy policy. Please check the box to give us your permission to do this.

Cancel

Choose a category below to quickly discover all our device intelligence articles.


  • Share
  • DeviceAtlas LinkedIn

You are here

User Agent String Analysis

A User-Agent string is a line of text that provides a web server with information about the device requesting access to the website, which triggers the server to select and send suitable content to that device. This information is crucial in ensuring that websites are rendered correctly on every browser and device.

Pawel Piejko - 19 Feb 2015
3 min read

User-Agent string analysis

Updated: September 2023

Why User-Agent String analysis is difficult

One of the most confusing aspects about User-Agent strings is that many of them look the same. In fact, most will look like this:

Mozilla/5.0 (Linux; Android 13; SAMSUNG SM-S918B) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/21.0 Chrome/110.0.5481.154 Mobile Safari/537.36

This is a User-Agent string for a Samsung Galaxy S23 Ultra, however, based on included keywords such as 'Mozilla', 'Mobile Safari', and 'AppleWebKit', the string alone could easily cause confusion. Let's break down each component:

  • Mozilla/5.0 – this means it’s a 'Mozilla compatible' browser. An historical
  • Linux; Android 13 – reference to the operating system, Android (based on Linux)
  • SAMSUNG SM-S918B – the specific device model name given by the Manufacturer
  • AppleWebKit/537.36 – the rendering engine
  • KHTML, like Gecko – the HTML layout engine
  • Chrome/110.0.5481.154 – the version of Chrome being used (version 110)
  • Mobile Safari/537.36 – the browser is 'Safari compatible'

Since the introduction of User-Agent Client Hints, extracting valuable information from User-Agent strings is now even more difficult as less information is provided on the initial request. Here's what a Samsung Galaxy S23 Ultra User-Agent string might now look like if Client Hints headers are not passed to the web server:

Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.0.0 Mobile Safari/537.36

As you can see, information about the specific model and browser version are no longer available, making it difficult to determine much about the device at all (access our resources on User-Agent Client Hints and the new landscape change here).

User-Agent spoofing

The technique of User-Agents' masquerading started in the very early days of Internet browsing. Below are two User-Agent strings originating from the mid-1990s:

  • Netscape Navigator 2: Mozilla/Version [Language] (Platform; Encryption)
  • Internet Explorer 3: Mozilla/2.0 (compatible; MSIE Version; Operating System)

Netscape Navigator 2, code named Mozilla, was the dominant browser at the time and offered more features than IE 3. Instead of adjusting websites to IE's limited capabilities, web developers often blocked users completely. In response to this, Microsoft made the decision that the early version of Internet Explorer would introduce itself as Mozilla to ensure end-users could view the content and to help the new browser grow its market share. Over time, other browsers adopted the same approach as a form of 'browser sniffing' and Mozilla quickly became a staple in any User-Agent string.

As seen above, legacy terms that were used 20-30 years ago are still present in User-Agents today.

Device detection must be based on User-Agent Strings and other HTTP headers

A device-aware content adaptation strategy including smartphones and tablets requires device identification to be carried out and doing some analysis of User-Agent strings.

Although searching for keywords in User-Agents can look like a reasonable approach to device detection, it certainly won’t return any accurate results for the reasons explained earlier in this article. 

For example a User-Agent string that contains the keyword 'iphone' doesn't necessarily mean the requesting device is really an iPhone. To accurately detect a device you need to analyse every aspect of the user-agent as well as other HTTP headers, and not just keywords. This is especially important if you require some fine-grained targeting, such as language and locale.

This is why sophisticated device intelligence solutions are utilized to ensure accuracy and speed of detection.

You can test DeviceAtlas's capabilities by following the steps below:

  1. Search online for User-Agent string examples, or search for any device using our Device Browser (e.g. iPhone 14) and copy its User-Agent (you can find it at the bottom of the device page – create a an account to do this).

  2. Head over to the User-Agent Tester and paste the User-Agent string. Click the result to find out what DeviceAtlas says about the selected device.

Try pasting more User-Agent strings to check the User-Agent Tester and learn about the DeviceAtlas’ accuracy.

Get started with a local device detection trial

DeviceAtlas is a high-speed device detection solution used by some of the largest companies in the online space to:

  • Optimize UX and conversion rate on mobile
  • Boost web performance
  • Target ads and analyze web traffic
  • Enable App analytics and advertising insights

Get started with a locally-installed trial to test DeviceAtlas at no cost.

Get started