A User Agent (UA) is a string of text sent by a web browser or application to a server when making a request to access a website or online service. The User Agent provides information about the browser, operating system, and device being used.
What is a User Agent used for?
- Identifying the device type - Helps websites adjust their display (e.g., mobile or desktop).
- Detecting the operating system and browser - Ensures compatibility with specific features or fixes browser-related issues.
- Logging data on the server - Used for analyzing user behavior and improving system performance.
- Preventing bots and attacks - Helps determine if the user is a real person or an automated bot.
Examples of User Agents
1. Chrome on Windows
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36
- Windows NT 10.0 - Running Windows 10
- Win64; x64 - 64-bit system
- Chrome/110.0.0.0 - Using Google Chrome version 110
- AppleWebKit/537.36 - Uses WebKit (rendering engine for Safari and Chrome)
2. Safari on iPhone
Mozilla/5.0 (iPhone; CPU iPhone OS 16_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Mobile/15E148 Safari/604.1
- iPhone OS 16.3 - Running iOS 16.3
- Safari/604.1 - Using Safari browser
3. Android on Samsung Galaxy
Mozilla/5.0 (Linux; Android 12; SM-G991B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Mobile Safari/537.36
- Android 12 - Running Android version 12
- SM-G991B - Device model: Samsung Galaxy S21
- Chrome/98.0.4758.102 - Using Google Chrome
How to Check Your User Agent?
You can check your User Agent by Using Developer Tools in Chrome:
- Press
F12 → Go to Console and type: navigator.userAgent - Visiting a website that displays your User Agent, such as: https://www.whatismybrowser.com/
Can You Change Your User Agent?
- Using browser extensions, such as
User-Agent Switcher. - Running a headless browser or
cURL to simulate different User Agents. - Modifying User Agent settings via JavaScript or HTTP headers.
Summary
- A User Agent is a string that identifies the browser, operating system, and device used to access a website.
- It helps adjust website displays, analyze user data, and prevent bots.
- You can check or modify your User Agent for various purposes.
📌 User Agents affect website accessibility and rendering. Changing your UA may help bypass certain restrictions, such as accessing websites that block specific devices. ✅