Generate random user agent strings for testing, development, and web scraping applications. Create custom browser fingerprints across various platforms, browsers, and versions. Use these user agents for QA testing, compatibility checks, or when developing web scraping tools.
A user agent is a string of text that web browsers and other applications send to websites to identify themselves. It typically includes information about the browser, operating system, device, and sometimes additional details about the client software.
Here's a breakdown of a typical user agent string:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36
Component | Example | Description |
---|---|---|
Browser Compatibility | Mozilla/5.0 | Historical reference to Netscape Navigator compatibility |
Platform/OS | (Windows NT 10.0; Win64; x64) | Operating system and architecture information |
Rendering Engine | AppleWebKit/537.36 (KHTML, like Gecko) | Browser's layout/rendering engine |
Browser Name & Version | Chrome/91.0.4472.124 | Browser name and specific version number |
Additional Info | Safari/537.36 | Additional compatibility or browser information |
Test how your website appears and functions across different browsers, operating systems, and devices without needing physical access to all of them.
Rotate through different user agents to avoid detection and rate limiting when developing web scrapers or automated tools.
Simulate different browsers and devices to test website security measures and potential vulnerabilities related to client detection.
Understand how websites detect and respond to different browser types and versions for compatibility research.
Browser | Sample User Agent String |
---|---|
Chrome (Windows) | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 |
Firefox (macOS) | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:89.0) Gecko/20100101 Firefox/89.0 |
Safari (iOS) | Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1 |
Edge (Windows) | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 Edg/91.0.864.59 |
Chrome (Android) | Mozilla/5.0 (Linux; Android 11; SM-G998B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.120 Mobile Safari/537.36 |
Here are examples of how to set user agents in common programming languages and tools:
// JavaScript (fetch API)
fetch('https://example.com', {
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
}
})
// Python (requests)
import requests
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
}
response = requests.get('https://example.com', headers=headers)
// PHP (cURL)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://example.com');
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36');
$response = curl_exec($ch);
curl_close($ch);