How to Parse User-Agent Strings
User-Agent
When to Inspect User-Agent
Debug analytics discrepancies, bot detection false positives, and mobile versus desktop routing when logs only include the raw UA string from requests or CDN reports.
Heuristic Labels Only
Browser and OS labels use simple pattern matching for debugging — not authoritative fingerprinting. Do not rely on this output for security allow/deny decisions; use structured Client Hints where available.
Developer Tips
- UA strings are easily spoofed — never use alone for authentication
- Prefer Sec-CH-UA headers in modern Chromium for structured data
- Log full UA for support tickets but hash or truncate in long-term storage
Frequently asked questions
Is bot detection supported?
Only basic heuristics are shown — use dedicated bot management for production.
Can I parse Client Hints here?
No. Paste traditional User-Agent strings; Client Hints use separate header names.