How websites detect bots and automated browsers
Websites detect bots by checking several layers of signals: automation flags, environment traces, consistency between values, the network and behavior. Bots fill in sign-up forms, abuse promo codes, scrape prices and try stolen passwords. Most of them run real browser engines controlled by scripts, so a User-Agent check alone no longer catches them.
Check your browser right now
Checking your browser…
Layer 1: automation flags
A browser driven by a tool such as Selenium, Puppeteer or Playwright with default settings usually reports navigator.webdriver = true, because the WebDriver standard requires it. Headless Chrome also names itself HeadlessChrome in the User-Agent unless the bot changes it. These are the cheapest checks. They catch careless bots, and any serious bot hides them.
Layer 2: environment traces
Headless and virtualized browsers differ from a desktop browser in small details: a software graphics renderer such as SwiftShader or llvmpipe instead of a real GPU, a window with an outer size of zero, missing objects that a real desktop Chrome always has, no speech voices or media devices, unusual screen sizes. Each trace also has innocent explanations, so good detectors weigh them together instead of blocking on one.
Layer 3: consistency and tampering
Bots that try to pass as human change values, picking a common User-Agent, a popular screen size and a plausible GPU name. Keeping every changed value consistent everywhere is hard, so detection compares the same fact taken from different sources:
- The User-Agent in the HTTP header and navigator.userAgent in JavaScript.
- Client Hints headers and navigator.userAgentData.
- The main page and a Web Worker or an iframe, which often keep the original values.
- The operating system named in the User-Agent and the GPU and fonts that are actually available.
- Whether built-in functions are still native code or have been replaced by a script.
A contradiction between two sources is much stronger evidence than any one odd value.
Layer 4: network
The IP address shows whether the visitor comes from a home or mobile provider or from a data center, whether the address is a known VPN, proxy or Tor exit, whether it appears in spam blacklists, and whether the browser's time zone fits the country of the IP. More advanced systems also fingerprint the TLS handshake (JA3, JA4) and the HTTP/2 settings, which reveal the real client library behind a forged User-Agent.
Layer 5: behavior
The last layer is how the visitor acts: mouse movement, typing rhythm, scrolling, how fast forms get filled in, how many accounts come from one device. Behavior catches bots that pass every technical check. It needs time and data, though, so it works best on top of the earlier layers.
What this means for a website owner
No single signal is reliable, and blocking on one produces false positives for real people with VPNs, privacy browsers or unusual hardware. A practical setup scores several signals together, adds friction (an email confirmation, a captcha, a manual review) only when the risk score is high, and protects the actions that matter most: sign-up, login, checkout and promo codes.
The SpoofLens API and the WordPress / WooCommerce plugin return such a score with the reasons behind it (in SpoofLens a lower score means a higher risk), and you decide whether to block. The check on this page runs the browser part of these checks in your own browser.
Frequently asked questions
- Is a captcha enough?
- Not on its own. Captcha-solving services and modern AI get through many captchas cheaply. Use a captcha as extra friction for visitors who already look suspicious, and do not rely on it as the only barrier.
- Will bot detection block my real users?
- It can, if it blocks on single signals such as a VPN or a privacy browser. False positives stay low when you weigh several signals and ask for extra proof instead of blocking.
- Does SpoofLens block bots on my site?
- Only if you want it to. The API returns a score and the reasons, and your code decides. The WordPress / WooCommerce plugin shows the score next to users and orders, and it blocks automated browsers or low scores only after you turn that on in its settings.
Read next
- Browser fingerprinting: what it is and how it works
- Canvas, WebGL and audio fingerprints: how they work
- WebRTC leak: what it is and how to check your browser
- Time zone vs IP: why websites notice your VPN
- How websites recognise antidetect browsers
- User-Agent Client Hints: what replaced the User-Agent string