User Agent Parser
Parse user agent strings.
About this tool
Paste a user-agent string and get a quick read of the browser, operating system and mobile flag. It checks for Edge, Opera, Firefox, Chrome and Safari, and for iOS, Android, Windows, macOS, ChromeOS and Linux.
How to use
How it works
The parser searches the string for known tokens in a fixed order, so Edge, Opera and Firefox (including Chrome and Firefox on iOS) are checked before Chrome, and Chrome before Safari. The OS check looks for iPhone and iPad first, because their strings also say Mac OS X. Mobile is true if the string contains Mobile, Android, iPhone or iPad. Version numbers are not extracted.
Worked example
Edge on Windows
- Input
- Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0
- Output
- { "raw": "Mozilla/5.0 (Windows NT 10.0; ... Edg/120.0.0.0", "browser": "Edge", "os": "Windows", "mobile": false }
- Walkthrough
- The Edg/ token wins over Chrome/ and Safari/, which also appear in the string.
Limitations
- Brave and Samsung Internet are reported as Chrome because their user agents do not name them.
- iPadOS 13 and later Safari can send a desktop Mac user agent, in which case it is reported as macOS.
- No version numbers, device model or bot detection.
Questions
How do I read a user agent string?
Why does my iPad show as macOS?
Does it show the browser version?
Why does Chrome user agent contain Safari?
Features
- Browser, OS, mobile
- Edge and Opera before Chrome ordering
- Runs in your browser
Related resources
Guides and videos from around the web—opens on YouTube or the publisher’s site.
Learn Regular Expressions - Crash Course
freeCodeCamp.org
Regex primer for tester and explainer pages.
Watch on YouTubeInspect Network Activity - Chrome DevTools 101
Chrome for Developers
Debugging payloads you paste into JSON and JWT tools.
Watch on YouTube
- Introduction to JSON Web Tokens
jwt.io
JWT structure for decoder and debugger pages.
- Base64
MDN
When Base64 is appropriate versus raw binary transfer.