User Agent Parser

Parse and analyze user agent strings to identify browser, operating system, device type, and version information.

Paste a user agent string or click "Use My Browser" to get started

Common User Agent Examples

Chrome on Windows

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

Firefox on macOS

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:121.0) Gecko/20100101 Firefox/121.0

Safari on iOS

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/604.1

Edge on Windows

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

Chrome on Android

Mozilla/5.0 (Linux; Android 13; Pixel 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Mobile Safari/537.36

Safari on 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/604.1

How User Agent Parsing Works

1

Browser Detection

The parser searches for browser-specific patterns like "Chrome/", "Firefox/", "Safari/", "Edg/", and "OPR/" to identify the browser. Order matters since some browsers include others in their user agent.

2

Operating System Detection

OS information is extracted by looking for patterns like "Windows NT", "Mac OS X", "Android", "iPhone OS", and "Linux". Version numbers are parsed using regular expressions.

3

Device Type Classification

The device type is determined by checking for keywords like "Mobile", "Tablet", "iPad", and desktop OS indicators. Tablets are identified before mobile devices for accurate classification.

4

Version Extraction

Version numbers are extracted using regex patterns that match the numeric values following browser and OS identifiers. Major and minor versions are captured when available.

Frequently Asked Questions

What is a user agent string?

A user agent string is a text identifier that web browsers send to websites when making requests. It contains information about the browser type, version, operating system, and device. This helps websites optimize content for different platforms and track browser usage statistics.

How do I find my browser's user agent?

Click the "Use My Browser" button on this page to automatically detect your current browser's user agent string. Alternatively, you can open your browser's developer console (press F12), type "navigator.userAgent", and press Enter to see your user agent string.

Why do websites check user agent strings?

Websites use user agent strings to deliver optimized content for different browsers and devices, ensure compatibility with browser-specific features, track analytics and usage patterns, detect mobile vs desktop users for responsive design, and provide appropriate download links for different platforms.

Can user agent strings be spoofed?

Yes, user agent strings can be easily modified using browser extensions, developer tools, or proxy services. They should not be relied upon for security purposes or critical functionality, but are useful for analytics, content optimization, and user experience improvements.

What information does a user agent reveal?

A user agent string typically reveals the browser name and version, operating system and version, device type (desktop, mobile, tablet), rendering engine (WebKit, Gecko, Blink), and sometimes information about installed plugins or browser capabilities. It does not reveal personally identifiable information.

Do all browsers use the same user agent format?

No, different browsers use slightly different formats, though most follow a similar structure inherited from early browsers. The format typically includes Mozilla compatibility information, browser identification, operating system details, and rendering engine information, but the exact syntax and details vary by browser vendor.

Related Tools