Random User Agent Generator

Realistic browser user-agent strings for testing

Generates valid, realistic user-agent strings for Chrome, Firefox, Safari, and Edge across desktop and mobile platforms. Useful for testing UA-detection logic, analytics parsing, and responsive behaviour. Runs entirely in your browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

Are these real, valid user-agent strings?

Yes. Each string follows the documented format for its browser and platform, using realistic version numbers and the correct token order, so it parses correctly in user-agent libraries and matches what real browsers send.

A user-agent string is the identification header a browser sends with every request, describing its engine, version, and platform. This generator produces valid, realistic strings for the major browsers across desktop and mobile so you can exercise UA-detection logic and parsing without manually copying real ones.

How it works

Each browser has a well-defined user-agent template. The tool fills these templates with plausible version numbers and the correct platform tokens:

Chrome/desktop: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
                (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Safari/iPhone:  Mozilla/5.0 (iPhone; CPU iPhone OS 17_4 like Mac OS X)
                AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Mobile/15E148 Safari/604.1
Firefox/Linux:  Mozilla/5.0 (X11; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0

When you constrain the browser or platform, the generator only draws templates that match; on Any it picks randomly across the whole valid matrix. Every string keeps the historical Mozilla/5.0 prefix and the engine tokens that real browsers still send for compatibility.

Why user-agent strings are structured the way they are

The Mozilla/5.0 prefix on every browser string — including Chrome, Safari, and Edge — is a historical accident that persists for compatibility. In the browser wars of the 1990s, web servers served better content to browsers that identified themselves as Mozilla (Netscape Navigator). Other browsers began claiming the prefix to receive the same content, and the practice stuck. Today every major browser includes Mozilla/5.0 in its UA string regardless of its actual rendering engine.

The engine token that follows is more meaningful:

  • AppleWebKit/537.36 (KHTML, like Gecko) identifies Blink-based browsers (Chrome, Edge, most of the web)
  • Gecko/20100101 identifies Firefox’s Gecko engine
  • AppleWebKit/605.1.15 identifies WebKit (Safari on Apple platforms)

The platform tokens (Windows NT 10.0; Win64; x64, iPhone; CPU iPhone OS 17_4) are what most detection code actually uses to distinguish device type and operating system.

The most common detection targets

If you are building or testing UA-detection logic, these are the strings your code most likely needs to handle correctly:

BrowserPlatformKey tokens to detect
ChromeDesktop WindowsWindows NT, Chrome/, no Mobile
ChromeAndroidAndroid, Mobile, Chrome/
SafariiPhoneiPhone, Safari/, Mobile/
SafariiPadiPad, Safari/, no Mobile
FirefoxDesktopGecko/, Firefox/
EdgeDesktopEdg/ (note: not Edge/)

What to use instead of UA parsing

Browser vendors are actively reducing and freezing UA strings as part of the Privacy Sandbox initiative. Chrome began reducing UA strings in 2022 and the process is ongoing. For new code, prefer:

  • Feature detection (if ('geolocation' in navigator)) over browser-version checks
  • CSS media queries over JS platform checks for responsive logic
  • User-Agent Client Hints (navigator.userAgentData) for cases where you genuinely need browser/OS information in JavaScript

Generate a batch of strings to cover your test matrix, then use them to verify your parser classifies each correctly before it encounters real user traffic.