Headless browser definition
A headless browser is a full browser engine, such as Chromium, Firefox or WebKit, running without its graphical user interface. Instead of clicking and typing, a program sends it commands: open this URL, wait for this element, click this button, return the HTML or take a screenshot.
Because it is a real browser engine, a headless browser executes JavaScript, applies CSS, handles cookies and storage, and builds the same page a human would see. That is the key difference from a plain HTTP client, which downloads the raw response and nothing else.
How headless browsers are controlled
Automation libraries talk to the browser through a remote control protocol:
- Chrome DevTools Protocol (CDP): the low-level protocol Chromium exposes for debugging and automation. Puppeteer, developed by the Chrome team, uses it, and Playwright uses it for Chromium.
- WebDriver and WebDriver BiDi: the W3C standard protocols behind Selenium and supported by all major browsers.
- Playwright: a Microsoft open-source framework that drives Chromium, Firefox and WebKit through one API.
Chrome historically shipped a separate, lighter headless implementation. In 2023 Google introduced a "new headless" mode that runs the same code as regular Chrome, which made headless Chrome behave much more like the desktop browser.
What headless browsers are used for
- Automated testing: end-to-end tests in CI pipelines, where no screen is available.
- Screenshots and PDFs: rendering pages or reports on a server.
- Scraping dynamic sites: pages that build their content with JavaScript or load data after user interaction. See best proxies for web scraping.
- Monitoring: checking that a checkout or login flow still works, or watching product pages, as in restock monitors.
- Generating valid sessions: some automation tools use a browser to pass JavaScript challenges and collect cookies before continuing with lighter requests.
Headless browser vs HTTP client
| Headless browser | HTTP client | |
|---|---|---|
| Runs JavaScript | Yes | No |
| Fingerprint | Real browser TLS and JS environment | Library fingerprint |
| Speed | Slower, seconds per page | Fast, milliseconds per request |
| Resource use | High CPU and memory | Very low |
| Bandwidth | Loads images, fonts and scripts | Only what you request |
That bandwidth difference matters with per-GB residential proxies; blocking images and media where possible keeps costs down, and the proxy cost calculator helps estimate the bill.
How websites detect headless browsers
Antibot systems look for traces that a browser is automated rather than used by a person. Well-known signals include:
- navigator.webdriver set to true, which the WebDriver specification requires for automated sessions.
- "HeadlessChrome" in the User-Agent of older headless modes.
- Missing or unusual values for plugins, languages, screen size, permissions or WebGL renderer.
- Side effects of CDP being attached to the page.
- Behaviour: no mouse movement, instant form filling, perfectly regular timing.
These checks are part of wider browser fingerprinting. The open-source community maintains "stealth" plugins that patch common signals, which are discussed in Playwright and Puppeteer stealth. Detection and patching evolve constantly, so no configuration is permanently undetectable.
Pros and cons
Pros
- Handles JavaScript-heavy sites and challenges that plain clients cannot.
- Produces a genuine browser TLS and HTTP/2 fingerprint.
- Mature, free, well-documented open-source tooling.
Cons
- Much slower and more resource-hungry than HTTP requests.
- Higher bandwidth per page.
- Automation artefacts can still give it away.
How to evaluate headless browser tools and services
Look at which engines are supported, how close the fingerprint is to a stock browser, how quickly updates follow new browser releases, and the cost of running browsers at your scale. Hosted browser services and antidetect browsers trade money for less infrastructure work. Browse options in the browsers category.