A user agent in web is a software application that interacts with a server, or a web application on behalf of an end-user.
Most commonly, the term refers to web browsers, but it can also include other tools like search engine bots, screen readers like JAWS, or mobile applications.
How Does a User Agent Work?
When we visit a website, our browser sends an HTTP request to the server. This request includes a user agent string, which provides information about the browser, such as
- The browser’s name and version.
- The operating system.
- The rendering engine (e.g., Blink, WebKit, Gecko).
- The device type (e.g., desktop, mobile, tablet).
This information allows websites to adjust content and actions based on user browsers.
For example in the case of a Mobile browser. It can often receive a mobile-friendly version of the site.
Or it can allow customizing web pages to specific web browsers, providing, for example, older browsers with simplified web pages.
We call this user agent string, HTTP User-Agent request header.
An HTTP request header provides the server with information in order to customize its response.
So in our case, the information, as the name of the request header implies, is about the user agent.
Example of a HTTP User-Agent request header
A common user agent string looks like:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36
Let’s elaborate on the format of the above user agent string.
The first part, Mozilla/5.0, is legacy identifier for compatibility. Almost all modern browsers include this, even though they are not necessarily running Mozilla (In our case the web browser is Google Chrome).
The second part, (Windows NT 10.0; Win64; x64) specifies the Operating System. In our example, Windows 10, 64-bit architecture.
The third part, AppleWebKit/537.36, indicates the rendering engine, which in this case is WebKit.
The fourth part, (KHTML, like Gecko) indicates that the render engine WebKit is compatible with KHTML (used by older browsers) and Gecko (used by Firefox).
The next part, Chrome/111.0.0.0, denotes the name and version of the browser being used.
And finally, the last part, Safari/537.36, indicates compatibility with Safari’s rendering engine.
How to check the user agent for your web browsing environment
Visiting UserAgentString is the most straightforward method.
It will automatically display the user agent of our browsing environment.

Web-crawling bots are also a type of user agent
Web crawlers are scripts that systematically scrape websites for search engine indexing, data mining and web archiving.
These user agents use user agent strings to identify themselves.
For example, Googlebot, Google’s web crawler, would use the following user agent string:
Googlebot/2.1 (+http://www.google.com/bot.html)
Web servers may offer special treatment to bots, such as bypassing registration.
Using the robots.txt file, web servers can also give instructions to web-crawling bots.
For example, a web server could instruct a bot to only index certain areas of a website.