What is a User Agent? Examples and Parsing Guide

Every time you visit a website, your browser sends a "greeting card" to the server. This greeting card is called the User Agent (UA) string. But what exactly is it, and why does it look so complicated?

Understanding the User Agent String

A User Agent is a line of text that identifies the software (browser), operating system, and device you are using.

Example:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36

Why Do We Need It?

  • Content Adaptation: Servers can serve different versions of a site (e.g., mobile vs. desktop) based on the UA.
  • Analytics: Website owners use UA data to understand what devices their visitors are using.
  • Debugging: Developers use it to troubleshoot browser-specific bugs.

How to Parse a User Agent

Reading a raw UA string is difficult because of its chaotic history and format. That's why we use parsers.

Check Your Own User Agent

Do you want to know what your browser is telling websites about you? Use our free tool to instantly decode your User Agent string.

πŸ‘‰ Check My User Agent

See your Browser name, Version, OS, CPU architecture, and Device type instantly.

Common User Agent Component

  • Mozilla/5.0: A standard prefix for modern browsers (used for compatibility).
  • Platform: Describes the OS (e.g., Windows NT 10.0, Macintosh, Linux).
  • Engine: Returns the rendering engine (e.g., Gecko, AppleWebKit).
  • Browser: The actual browser name and version (e.g., Chrome/90.0, Firefox/88.0).

Share this post

What is a User Agent? Examples and Parsing Guide