A user-agent string is a short label your browser or app sends to websites, saying what software it is.
This guide is for anyone curious about what websites learn when they visit, and for people who look after a small website. You do not need to code: if you run a site, its visitor records are full of these labels, and some of them are fake.
In short
- Every time you open a web page, your browser sends a label naming its type, version and often your operating system.
- The label is written by the sender, so any program can claim to be a normal browser or a well-known search engine bot.
- Bots fake the label to blend in, get past simple blocks or pretend to be a trusted crawler.
- To trust a visitor that claims to be a known bot, check it another way, such as the owner's published address list.
What you will learn
- Explain what a user-agent string is in one sentence.
- Read the main parts of a typical browser label.
- Spot why a label on its own does not prove who a visitor is.
- Check a visitor that claims to be a well-known bot.
- Software name label (user-agent string)
- a line of text a browser or app sends to say what software it is.
- Automated visitor (bot)
- a program that visits websites on its own, without a person clicking.
- Faking the label (user-agent spoofing)
- sending a false label so a program looks like something else.
What is a user-agent string?
Think of a luggage tag you fill in yourself at the airport. It tells staff whose bag it is, but nobody checks that what you wrote is true.
A user-agent string works the same way. When your browser asks a website for a page, it sends some extra notes with the request. These notes are called headers. One of them, the User-Agent header, says which app, version and operating system is asking.[1]
Websites use the label for ordinary jobs. They might show a mobile layout to phones, or count how many visitors use each browser. Search engines and AI companies also give their bots names, so site owners can tell them apart.[4]
Where the comparison stops working: a luggage tag stays the same for the whole trip. A program can change its label on every single request, as often as it likes.
Why does it matter?
Because anyone can write the label, it is a claim, not proof. A bot can say it is a normal browser to blend in with people. It can also claim to be a trusted search engine bot, hoping the site lets it through.[3]
If you run a small website
What could happen: you allow anything labelled as a search engine bot, and a copying tool uses that label to take your content.
Check this: ask your web host or helper how they confirm that a "search engine" visitor is real.
If you are learning web development
What could happen: you build a feature that reads the label to guess the browser, and it breaks when the label changes.
Check this: test whether the browser supports the feature you need, rather than reading its name.
If you care about your privacy
What could happen: the label is one of many small details a site can combine to recognise your device.
Check this: keep your browser up to date, as modern browsers now send less detail in the label.
What does it look like?
Here is a made-up extract from a small website's visitor records. Each line shows an address, the page asked for and the label sent.
Example only. All values are made up.
192.0.2.10 GET /prices Mozilla/5.0 (Windows NT 10.0; Win64; x64) ... Chrome/000.0.0.0 (1) 198.51.100.7 GET /prices Mozilla/5.0 (compatible; ExampleSearchBot/1.0; +https://example.com/bot) (2) 203.0.113.44 GET /prices Mozilla/5.0 (compatible; ExampleSearchBot/1.0; +https://example.com/bot) (3) 203.0.113.44 GET /prices?page=2 (same label, 500 times in a minute) (4)
- A normal-looking browser label. "Mozilla/5.0" appears in almost every browser label for historical reasons, not because the visitor uses Firefox.
- A bot that names itself and gives a web page about who runs it.
- The same bot name from a different address. Check whether this address belongs to the bot's owner.
- Hundreds of fast requests under a trusted name. A person browsing does not usually behave like this.
Why this is risky: if the site trusts the name alone, line 3 is treated like the real bot. It could be a copying tool in disguise.
The safer way: treat the label as a claim. Check claimed search engine bots against the owner's own checking method, and limit how fast any visitor can ask for pages.
How does it work?
Here is what happens to the label on a typical visit, and how a careful site treats it.
- The visit. Your browser asks a website for a page and adds the User-Agent header to the request.[1]
- The label. It usually starts with "Mozilla/5.0", then gives system details, the browser engine and the browser name and version.[1]
- Less detail than before. To protect privacy, some browsers now send a reduced label. Parts like the exact device model can be replaced by fixed values. A site that needs more detail has to ask, using a newer feature called client hints.[1]
- The site reads it. The site might pick a layout or log the visit. Experts warn that guessing the browser from the label is hard to do reliably, because browsers often copy parts of each other's labels.[2]
- The check. For a visitor that claims to be a known bot, a careful site checks it another way. Google, for example, describes a check that looks up the visitor's address, and also publishes lists of the addresses its crawlers use.[3]

Some AI companies run several bots with different names for different jobs. For example, one may gather pages that could be used to train AI models, while another fetches a page because a person asked a question. They publish each bot's name and address list, so site owners can make a separate choice for each.[4]
A worked example
Amara Strand runs Marigold Garage, a fictional car repair business with a small website. Her site lists prices for common jobs, such as an oil change.
One morning her site feels slow. She looks at the visitor report her web host provides. Thousands of requests have hit the prices page overnight, all labelled as a well-known search engine bot.
Amara remembers the luggage tag. Anyone can write a name on it. So she does not block the bot by name, because the real search engine helps customers find her.
Instead, she asks her web host to check the claim. The host compares the visitor addresses with the search engine's published address list. The real bot's visits match the list. The overnight flood comes from addresses that are not on it.
The host blocks those addresses and sets a limit on how many pages one visitor can request each minute. The real search engine bot carries on visiting as normal.
The next week, the site is quick again. Amara asks her host to keep the address check switched on for any visitor that claims to be a known bot. She also notes that she should review the setting once a year.
Myths and mistakes
| What people think | What is true |
|---|---|
| The user-agent string proves which browser or bot is visiting. | It is a claim the sender writes, and it can be changed or faked.[2] |
| "Mozilla" in the label means the visitor uses Firefox. | Almost every browser sends "Mozilla/5.0" for historical reasons.[1] |
| Blocking a bot's name blocks the bot. | A bot that does not want to be blocked can send a different name. Limits and checks work better. |
| Allowing every visitor named after a search engine is safe. | Copying tools can borrow that name. Check the address against the owner's published list.[3] |
| The label shows my exact phone model and system version. | Many modern browsers now send a reduced label with fixed values for some parts.[1] |
What can I do this week?
- Look at your website's visitor report and find the most common labels.
- Ask your web host how it checks visitors that claim to be search engine bots.
- Ask whether your site limits how many pages one visitor can request in a minute.
- If you build websites, test for the features you need instead of reading the browser name.
- Keep your own browser up to date.
Checklist
- We treat the user-agent label as a claim, not as proof of identity.
- Visitors claiming to be known bots are checked against the owner's published list or method.
- Our site limits how fast one visitor can request pages.
- We do not give extra access based on the label alone.
- Our website features do not depend on guessing the browser from its label.
- Someone reviews our bot settings at least once a year.
Common questions
What is my user agent?
It is the label your browser sends with each request, naming the browser, its version and usually your operating system. Many websites will show you yours. Modern browsers often send a reduced version, so some parts may be fixed values rather than your exact details.
Why does every browser say Mozilla?
For historical reasons. Browsers copy words from each other's labels so that websites keep working with them. Today "Mozilla/5.0" appears in almost every browser label, so it tells you very little about the actual browser.[1]
Is changing my user agent illegal?
Changing it is a normal feature, and developers use it to test how sites look on other devices. What matters is what you do with it. Using a fake label to get round a site's rules or access controls may break its terms, and in some cases the law.
How can I tell if a bot is really from a search engine?
Use the search engine's own checking method. Google, for example, explains how to look up a visitor's address and confirm it belongs to Google, and also publishes lists of its crawler addresses. If the address does not match, treat the visitor as unknown.
Can AI bots be identified by their user agent?
Partly. Several AI companies publish the names their bots use and lists of the addresses they come from. The name is still only a claim, so check the address list as well before giving any bot special treatment.
Where next?
Ready for the detail? Read the practitioner guide: Bot vs AI Agent Traffic Management Guide. It goes further into sorting crawlers, AI fetchers and browsing agents, signed bot requests and how to build and measure a traffic policy.
Also useful:
- Bot Management Guide
- Bots and Bot Traffic for Beginners
- Device Fingerprinting for Beginners
- Rate Limiting for Beginners
- AI Crawler and Scraper Controls
Related NHI Mgmt Group resources: Web Scraping Defence Guide · IP Reputation and Blocklists for Beginners · How the Web Works for Beginners
Key terms
- User-agent string
- A request header in which a browser or app names its type, version and often its operating system.
- HTTP header
- An extra note sent with a web request or reply that tells the other side how to handle it.
- User-agent spoofing
- Sending a misleading label so automated traffic looks like a normal browser or a trusted bot.
- User-agent client hints
- Extra headers a browser can send with chosen device and browser details when a site asks for them.
- Web crawler
- A program that visits web pages, follows links and collects content, for example for a search engine.
- Reverse DNS
- Looking up the name linked to an internet address, used as one way to check who runs a visitor.
- Browser fingerprinting
- Recognising a browser or device by combining many small details about it.
Sources and further reading
- User-Agent header. MDN Web Docs, Mozilla. https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/User-Agent, accessed 28 Nov 2026.
- Browser detection using the user agent. MDN Web Docs, Mozilla. https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Browser_detection_using_the_user_agent, accessed 28 Nov 2026.
- Verifying Googlebot and other Google crawlers. Google Search Central, Google. https://developers.google.com/search/docs/crawling-indexing/verifying-googlebot, accessed 28 Nov 2026.
- Overview of OpenAI crawlers. OpenAI developer documentation, OpenAI. https://developers.openai.com/api/docs/bots, accessed 28 Nov 2026.