User Agent Parser

Parse user agent strings.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

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

1
Step 1
Paste the full user-agent string.
2
Step 2
Press Run.
3
Step 3
Read browser, os and mobile in the result.

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?
Paste it into the tool. It reports the browser, OS and a mobile flag.
Why does my iPad show as macOS?
Recent iPads can ask websites for the desktop version, and then the user agent looks like a Mac. iPhones and iPads that send a mobile user agent are reported as iOS.
Does it show the browser version?
No. Only the browser family is identified.
Why does Chrome user agent contain Safari?
Historical compatibility; most Chromium browsers include Safari/ in the string.

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 YouTube
  • Inspect Network Activity - Chrome DevTools 101

    Chrome for Developers

    Debugging payloads you paste into JSON and JWT tools.

    Watch on YouTube