Firefox vs Chrome User-Agent String Comparison
Side-by-side comparison of Firefox and Chrome User-Agent string formats. Understand the structural differences and how to reliably distinguish them.
Advanced
Detailed Explanation
Firefox vs. Chrome User-Agent String Comparison
Firefox and Chrome have fundamentally different UA string structures. Understanding these differences is key to reliable browser detection.
Side-by-Side Comparison
Chrome (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 (Windows):
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0
Structural Differences
| Component | Chrome | Firefox |
|---|---|---|
| Prefix | Mozilla/5.0 | Mozilla/5.0 |
| Platform | (Windows NT 10.0; Win64; x64) | (Windows NT 10.0; Win64; x64; rv:121.0) |
| Engine | AppleWebKit/537.36 | Gecko/20100101 |
| Compatibility | (KHTML, like Gecko) | (not present) |
| Browser | Chrome/120.0.0.0 | Firefox/121.0 |
| Legacy | Safari/537.36 | (not present) |
| Extra | (none) | rv:VERSION in platform |
Key Identification Tokens
To identify Firefox vs Chrome:
- Firefox → has
Firefox/token andGecko/engine - Chrome → has
Chrome/token andAppleWebKit/engine
Common Parsing Mistakes
- Checking for "Mozilla" — Both start with
Mozilla/5.0, so this does not distinguish them - Checking for "Gecko" — Chrome includes
(KHTML, like Gecko)in its UA, but this is different fromGecko/20100101 - Checking for "Safari" — Chrome includes
Safari/537.36but Firefox does not
Version Number Formats
- Chrome: 4-part version (120.0.0.0) with major updates every ~4 weeks
- Firefox: 2-part version (121.0) with major updates every 4 weeks
User-Agent Reduction
Both browsers are working on reducing UA information to combat fingerprinting:
- Chrome: Gradually freezing minor version, OS version, and model information (User-Agent Reduction / UA-CH)
- Firefox: Considering similar reductions, already freezes
Gecko/20100101
Use Case
Web developers compare Firefox and Chrome UA strings when debugging cross-browser issues. Understanding the structural differences helps when writing regex patterns for UA parsing libraries or configuring server-side browser detection in nginx, Apache, or CDN rules.