top
logo
articleBlog
custom iconFeature overview
language-switch

User-Agent Parsing Made Easy: Chrome, Edge, Firefox, and Devices Explained

User-Agent Parsing Made Easy: Chrome, Edge, Firefox, and Devices ExplainedTestdateTime2025-10-31 14:15
iconiconiconiconicon

The 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.

ScreenShot_2025-10-16_182747_717.webp

What is User-Agent string parsing?

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:

 
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 

This string clearly informs the server that the visitor is using Windows 10, the Chrome browser, and the WebKit rendering engine.

Two,User-Agent Analysiscommon methods

1. Regular expression matching and parsing

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:

 
Chrome/([\d.]+)

It can match the version number of the Chrome browser.

2. Third-party library analysis

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.)

3. Professional Platform Analysis (Recommendations)

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.

3. Browser and Device UA Parsing Example Table

TypeExample UA stringkernelSystemEquipmentAnalysis explanation
Chrome DesktopMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36BlinkWindows 10PCWindows system, Chrome browser, desktop device
Edge DesktopMozilla/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.60BlinkWindows 10PCEdge browser, desktop devices, Blink engine
Firefox DesktopMozilla/5.0 (Windows NT 10.0; Win64; x64; rv:117.0) Gecko/20100101 Firefox/117.0GeckoWindows 10PCFirefox browser, desktop device
Safari DesktopMozilla/5.0 (Macintosh; Intel Mac OS X 13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15WebKitmacOS 13PCSafari browser, desktop device
iPhoneMozilla/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.15WebKitiOS 17Mobile phoneiPhone, mobile device, Mobile field prompt mobile端
iPadMozilla/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.15WebKitiPadOS 17tabletiPad, tablet devices, Mobile field to indicate mobile端.
Android phoneMozilla/5.0 (Linux; Android 13; Pixel 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Mobile Safari/537.36BlinkAndroid 13Mobile phoneAndroid phone, mobile device, the Mobile field indicates mobile端.

4. Techniques for User-Agent Parsing on Different Browsers and Devices

1. UA identification of mobile phones and tablets

The UA of mobile phones and tablets usually includes the Mobile or Tablet field.

Example:

 
Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 Mac OS X) AppleWebKit/605.1.15 (KHTML, Gecko) 版本/17.0 Mobile/15E148 Safari/605.1.15 
  • Recognizing the iOS system through iPhone OS.

  • Determine a mobile device via Mobile.

2. Desktop Browser Identification

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.

3. Handling forged UA

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.

Summary

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.

adAD
Related Articles
previewBrowser Engine Detection + User-Agent Analysis: Easily Identify Browser Type and Version
previewUser-Agent Parsing Made Easy: Chrome, Edge, Firefox, and Devices Explained
previewTop 5 Best Free User-Agent Parsing Tools: Which One is Right for You?
View Morenext
Table of Contents
Recommended Articles
previewHow to Use ToDetect to Check Your Browser Fingerprint?
previewThe Ultimate Anti-Linking Tool for Multi-Account Matrix Marketing: Browser Fingerprint Detection
previewOne-Click Browser Fingerprint Check! The Ultimate Guide to Preventing Account Linking and Bans on Amazon/eBay Multi-Store Operations
View Morenext