A user agent is the software that acts on a user's behalf to access the web — most commonly a browser, but also search engine crawlers, API clients, and scripts. With every HTTP request, the user agent sends a User-Agent header: a text string that identifies the client's name, version, rendering engine, and operating system. Servers read this string to decide how to respond.
A typical browser user-agent string is a dense, historically messy line packed with tokens like Mozilla/5.0, the platform, and the browser engine and version. This clutter exists for backward-compatibility reasons dating back decades. Parsing it reliably requires care, which is why dedicated user-agent parsers exist to extract the browser, version, device type, and OS cleanly.
User agents matter for analytics, compatibility, and security. Analytics platforms parse them to report which browsers and devices your audience uses. Servers may serve different content or assets based on the client. Search engine bots identify themselves — Googlebot, Bingbot — with distinctive user agents, letting sites verify and manage crawler access through robots.txt rules.
It is important to remember that the user-agent string is self-reported and easily spoofed. Bots and scrapers routinely impersonate real browsers to avoid detection, so the header alone is not a trustworthy security control. For crawler verification, combine the user agent with reverse DNS checks. For feature decisions, modern development favors feature detection over user-agent sniffing.