User Agent Generator
QA engineers who need a phone UA in an automated browser test, backend developers reproducing a mobile-only rendering bug from a terminal, and SEO specialists checking what a site returns to Googlebot versus a normal visitor all keep a stash of user agent strings somewhere. Copy-pasting them out of old Stack Overflow answers is how stale Chrome 80 strings end up in production test suites.
This generator holds a curated library of current desktop, mobile, and tablet user agent strings for Chrome, Firefox, Safari, and Edge across every major platform. Filter down to what you need, copy any row, or hit Generate for a random pick, then verify how a parser classifies the string before you wire it into a test.
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 | Browser | OS | Device | Version |
|---|
How user agent strings are structured
A user agent string is a space-delimited list of tokens with parenthesized product comments in the middle. The leading Mozilla/5.0 token is a historical compatibility marker that nearly every browser sends regardless of engine. Inside the parentheses sit the platform tokens such as Windows NT 10.0, Intel Mac OS X, or Linux with an x86_64 identifier, followed by the engine token like AppleWebKit or Gecko.
Chromium browsers append their own product token, Chrome/131.0.0.0, after the shared AppleWebKit token, and Edge and Opera add Edg/ and OPR/ markers on the end so servers can tell them apart from plain Chrome. Firefox uses the Gecko/20100101 Firefox/133.0 form and never includes AppleWebKit. Safari on Apple platforms carries a Version/ token plus a Mobile/15E148 token on phones and tablets.
The generator reads these same tokens when it classifies a string for the verification panel. It checks the Edge, Opera, and Samsung markers before the generic Chrome token, because Chromium-based browsers all contain a Chrome substring and order matters. The Mobile token and the iPhone or Android identifiers decide the device class, while an iPad identifier overrides to tablet.
Before and after: a curl request with a spoofed UA
Input, a request with the default curl user agent:
curl https://example.com/page
User-Agent: curl/8.5.0
→ server returns the bare-bones desktop HTML Output, the same request with a generated Android Chrome UA:
UA: Mozilla/5.0 (Linux; Android 14; Pixel 8)
AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/131.0.0.0 Mobile Safari/537.36
curl -H "User-Agent: $UA" https://example.com/page
→ server returns the mobile template and AMP headers
parse check: Chrome · Android · mobile ✓ Paste the same string into the verification panel above and the classifier reports Chrome on Android as a mobile device, confirming the header will trigger the mobile branch before you send it anywhere.
Who generates user agent strings
Developers
- Set a mobile UA in a Playwright or Cypress config to assert the responsive navigation renders in CI without a device farm.
- Reproduce a user-agent-specific CDN cache miss from the terminal by sending the exact header the affected client used.
- Unit test a UA parsing function against a fixed table of strings pulled from this library.
Production
- Compare what a marketing site returns to a normal browser versus a verified Googlebot UA before a migration sign-off.
- Verify a bot-detection rule does not accidentally block legitimate Safari on iPad traffic during rollout.
- Capture the mobile response for a client bug report when the issue only reproduces on a phone network.
Workflow
- Generate a random mobile UA, verify the parse, and drop it into a curl alias used for spot-checking staging.
- Keep a filtered desktop Firefox string next to the Chrome one in a gist so the whole team pulls consistent test fixtures.
- Pair UA checks with the HTTP header parser when auditing what a site actually sends back in its responses.
Common mistakes with user agent strings
- Using a frozen Windows NT 10.0 token to detect Windows 11. UA reduction froze that token years ago, so every Windows version from 10 onward reports NT 10.0. Detect the real platform through the User-Agent Client Hints API or accept that the header cannot distinguish 10 from 11.
- Matching Chrome before checking for Edge or Opera markers. Every Chromium browser contains the substring Chrome, so a naive substring test classifies Edge as Chrome. Check the Edg, OPR, and SamsungBrowser tokens first, which is the same order this tool uses.
- Forgetting the Mobile token on Android strings. Some Android tablets omit Mobile, and servers often treat its presence or absence as the phone versus tablet switch. When building a test fixture, copy a full known-good string rather than editing tokens by hand.
- Baking a pinned version number into a permanent test. A fixture that requires Chrome/131.0.0.0 exactly will break the moment your headless browser updates. Assert on family and device tokens instead of the full version, or refresh fixtures on a schedule.
Best practices for working with user agents
- 1.Store user agent fixtures in a versioned test data file with the date they were captured, so refreshing them later is a one-file change.
- 2.Match on browser family and device class in assertions rather than exact version strings, which keeps suites green across browser updates.
- 3.Verify any generated string through the parse panel before wiring it into CI, so a typo does not silently test the wrong branch.
- 4.Read the User-Agent Client Hints API docs before building a feature that depends on exact OS versions, because the classic header no longer carries that data.
Frequently asked questions
What is a user agent string?
A user agent string is the short text a browser sends in the User-Agent header of every HTTP request, describing the browser, rendering engine, operating system, and device type. Servers read it to decide whether to serve a mobile layout, which codecs a device can play, or whether to block automated scrapers. The format is a vendor-specific convention rather than a strict standard, which is why the strings look so inconsistent across browsers.
Why would I need to generate a user agent string?
QA engineers write automated tests that must assert different layouts for mobile versus desktop, and those tests often set the User-Agent header to simulate a phone without a real device farm. Developers debugging a mobile-only bug on a desktop machine spoof the UA in devtools or curl to reproduce the server response. Security researchers and SEO specialists also compare what a site returns to a Googlebot UA versus a normal browser UA.
Is spoofing a user agent legal?
Sending a different User-Agent header than the one your browser natively uses is legal and is a normal part of software testing. What can breach a site terms of service is using spoofed identities to evade access controls, scrape content the site forbids, or manipulate ranking systems. Use the strings here for your own testing, staging environments, and debugging, and respect the robots rules and terms of any third-party site you interact with.
How current are the user agent strings in this tool?
The bundled library tracks recent stable versions of Chrome, Firefox, Safari, and Edge across Windows, macOS, Linux, Android, iOS, and iPadOS, and it is refreshed as major versions roll. Because browsers update every few weeks, treat the exact version number as representative of a current build rather than a guarantee of what shipped this morning. The structure of each string is what matters for most tests, since parsers key off the family tokens rather than the patch version.
What is the difference between desktop and mobile user agent strings?
Mobile strings include a Mobile or Mobile/ token and name the device model or platform version, such as Android 14 with a Pixel or Samsung identifier, while desktop strings identify the operating system version and leave out the Mobile token. iPad strings look like iPhone strings but use iPad instead of iPhone, which is how servers distinguish the two. The device filter in this tool applies exactly that classification.
Can I use these strings with curl or Postman?
Yes. Copy any string from the list and pass it to curl with the -H flag as a User-Agent header, or paste it into the request headers panel in Postman, Insomnia, or any HTTP client. This is the fastest way to reproduce what a mobile user sees from a terminal when investigating a user-agent-specific bug in a CDN rule or a responsive breakpoint.
How do modern browsers hide user agent details?
Recent browser versions freeze or reduce the information in the User-Agent header, a process called UA reduction, so Chrome now reports a frozen Windows NT 10.0 token even on Windows 11 and trims the full version string. The User-Agent Client Hints API exposes the accurate version and platform to sites that opt in through Accept-CH headers. The strings in this tool follow the reduced format, which is what current browsers actually send.
Related request and testing tools
Break down any UA string into browser, OS, and device details
Parse raw HTTP headers and audit security and cache directives
Construct REST requests and compile executable cURL commands
Test crawl rules against specific user agents and URLs
Inspect network captures for request counts, sizes, and redirects
Convert API specs into Postman collections for request testing