 Blog
BlogThe User-Agent string (abbreviated as UA) that people often hear is an essential "business card" used by every browser and device when communicating with servers. Correctly parsing the User-Agent string can not only help improve user experience but also enhance website security and precision in marketing.
However, since everyone uses different browsers and devices, many people are still unclear about how to properly parse it. Next, let me explain how to parse the User-Agent strings from different browsers and devices.

In simple terms, the User-Agent string is a piece of text information that the browser or device sends to the server when accessing a webpage.
The UA string for the Chrome browser is as follows:
This string clearly informs the server that the visitor is using Windows 10, the Chrome browser, and the WebKit rendering engine.
Match browser name, version number, and operating system using regular expressions. The method is simple, but it is prone to misjudgment when facing complex and variable UA strings.
Example:
It can match the version number of the Chrome browser.
To improve accuracy, many developers choose to use mature parsing libraries, such as UAParser.js for JavaScript or user-agents for Python.
These libraries can be easily accessed:
Browser name and version
Operating System Type
Device type (mobile phone, tablet, PC, etc.)
For enterprise-level applications or security scenarios, solely relying on regular expressions or open-source libraries may not be sufficient to handle spoofed UAs or high-complexity situations.
At this time, professional platforms such as ToDetect for browser fingerprint detection have become particularly important.
It not only parses UA strings but also combines browser fingerprinting technology to achieve more accurate identification of user devices and environments, greatly enhancing the professionalism and reliability of the parsing.
| Type | Example UA string | kernel | System | Equipment | Analysis explanation | 
|---|---|---|---|---|---|
| Chrome Desktop | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 | Blink | Windows 10 | PC | Windows system, Chrome browser, desktop device | 
| Edge Desktop | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.2045.60 | Blink | Windows 10 | PC | Edge browser, desktop devices, Blink engine | 
| Firefox Desktop | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:117.0) Gecko/20100101 Firefox/117.0 | Gecko | Windows 10 | PC | Firefox browser, desktop device | 
| Safari Desktop | Mozilla/5.0 (Macintosh; Intel Mac OS X 13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15 | WebKit | macOS 13 | PC | Safari browser, desktop device | 
| iPhone | Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/605.1.15 | WebKit | iOS 17 | Mobile phone | iPhone, mobile device, Mobile field prompt mobile端 | 
| iPad | Mozilla/5.0 (iPad; CPU OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/605.1.15 | WebKit | iPadOS 17 | tablet | iPad, tablet devices, Mobile field to indicate mobile端. | 
| Android phone | Mozilla/5.0 (Linux; Android 13; Pixel 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Mobile Safari/537.36 | Blink | Android 13 | Mobile phone | Android phone, mobile device, the Mobile field indicates mobile端. | 
The UA of mobile phones and tablets usually includes the Mobile or Tablet field.
Example:
Recognizing the iOS system through iPhone OS.
Determine a mobile device via Mobile.
Desktop browser UA is relatively standardized, but there are significant differences between browser engines:
Chrome, Edge, Opera: Use the Blink engine
Firefox: Uses the Gecko engine
Safari: uses the WebKit engine
During analysis, precise judgments can be made by combining kernel information and browser version.
Some users or crawlers may modify their UA to circumvent restrictions, at which point a professional analysis platform (such as ToDetect browser fingerprint detection) can verify the authenticity of the UA through multidimensional data.
For example: By combining screen resolution, plugin information, Canvas fingerprinting, and other methods, significantly improve the accuracy of spoofed UA detection.
For User-Agent parsing, although traditional methods (regular expressions, open-source libraries) can meet basic needs, facing the complex and ever-changing browser ecosystem and the risk of spoofed UAs, using professional tools like ToDetect for browser fingerprint detection can provide higher accuracy and professionalism.
Correctly mastering the User-Agent parsing method can not only enhance user experience but also help websites gain an advantage in SEO optimization, data analysis, and security protection.
 AD
AD Browser Engine Detection + User-Agent Analysis: Easily Identify Browser Type and Version
Browser Engine Detection + User-Agent Analysis: Easily Identify Browser Type and Version User-Agent Parsing Made Easy: Chrome, Edge, Firefox, and Devices Explained
User-Agent Parsing Made Easy: Chrome, Edge, Firefox, and Devices Explained Top 5 Best Free User-Agent Parsing Tools: Which One is Right for You?
Top 5 Best Free User-Agent Parsing Tools: Which One is Right for You?
 How to Use ToDetect to Check Your Browser Fingerprint?
How to Use ToDetect to Check Your Browser Fingerprint? The Ultimate Anti-Linking Tool for Multi-Account Matrix Marketing: Browser Fingerprint Detection
The Ultimate Anti-Linking Tool for Multi-Account Matrix Marketing: Browser Fingerprint Detection One-Click Browser Fingerprint Check!  The Ultimate Guide to Preventing Account Linking and Bans on Amazon/eBay Multi-Store Operations
One-Click Browser Fingerprint Check!  The Ultimate Guide to Preventing Account Linking and Bans on Amazon/eBay Multi-Store Operations