What is a headless browser?
Definition
A real browser engine run from code with no visible window. It executes JavaScript like a normal browser, at many times the cost of a plain request.
Chrome, Firefox and WebKit can all run this way, usually driven by Playwright, Puppeteer or Selenium through the Chrome DevTools protocol or W3C WebDriver. You get JavaScript, cookies, layout and rendering exactly as a page expects them. You pay for that in memory, time and bytes, and you inherit a set of defaults that tell the site the browser is automated.
Chrome now has two headless modes. --headless runs the normal Chrome browser without a window. The older, separate implementation survives as a standalone binary, chrome-headless-shell, which Playwright uses by default for headless runs. They behave differently, as the figures below show.
Do you need one?
| Situation | Browser needed? | What to do instead |
|---|---|---|
| The data is in the HTML you already receive | No | Parse the response |
| The page fills itself from a JSON request | No | Find the request in the network panel and call it directly |
| Content is built by JavaScript with no separate data request | Yes | — |
| The site serves a JavaScript challenge | Usually | Fix the signals that triggered it first; see CAPTCHA |
| The task needs clicks, scrolling or form entry | Yes | — |
The second row is the one most often missed. Many pages that look rendered are a shell plus one API call, and the API response is smaller, steadier and easier to parse than anything you would scrape from the DOM.
What it costs
On a per-gigabyte plan the bill tracks every byte the browser pulls in. Loading three pages in headless Chrome 155 with the cache disabled transferred between 8 and 40 times the size of each page’s HTML: 493,843 bytes for a Wikipedia article whose HTML is 62,844, and 2,191,098 bytes across 201 requests for GitHub’s curl repository page. Blocking images, fonts and media saved only 3 to 28 percent, because scripts were most of the weight. The breakdown is in bandwidth billing.
The browser also makes requests of its own. Started with a fresh profile and pointed at a byte-counting proxy to load example.com once, Chrome 155 opened 11 tunnels, only 2 of them to example.com. The other 9 went to Google update, account and service hosts and carried about 104 KB, six times the page. With --disable-background-networking --disable-component-update it opened 6 tunnels, 4 of them still to Google, carrying about 36 KB. On a metered proxy those bytes are billed like any others.
The defaults that give it away
Left at its defaults, the browser announces itself before any fingerprinting script runs. Chrome 155 started with --headless sent this user agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/155.0.0.0 Safari/537.36
In the same request it sent client hints that leave the word out:
sec-ch-ua: "Google Chrome";v="155", "Chromium";v="155", "Not(A:Brand";v="24"
Two headers from one browser, contradicting each other. Inside the page it reported an 800 × 600 screen. The headless shell, Chrome for Testing 148.0.7778.96, went further: navigator.webdriver was true with no automation flag passed, no plugins were listed, WebGL did not start, and its client hints named HeadlessChrome outright. The property-by-property comparison is in browser fingerprinting.
A real user agent, a common window size and a timezone and locale that match the exit address remove the loudest tells. None of that touches the TLS handshake, which is already a browser’s. That is the real advantage a browser has over an HTTP client claiming to be one: the handshake measured in the TLS ClientHello fingerprint study is genuine, and so is the header set compared in What HTTP clients send before you configure anything.
Running one through a proxy
# Google Chrome 155 on macOS: send all traffic through a proxy, print the rendered DOM
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --headless \
--proxy-server="http://gw.example.net:8000" \
--disable-background-networking --disable-component-update \
--dump-dom https://example.com/
Pointed at our local test proxy instead of the placeholder, this printed the page with its title, Example Domain. For a proxy that needs a username and password, use the automation library’s own option: Playwright takes server, username and password in its launch options. Whether an agent should drive a browser at all is weighed in Proxies for AI agents that browse.
How this was measured. 21 October 2026, macOS on Apple silicon. Google Chrome 155.0.8059.85 and Chrome for Testing 148.0.7778.96 chrome-headless-shell, each with a fresh profile. Page weights summed encodedDataLength from the DevTools protocol with the cache disabled. The background-traffic test used a 26-line Python CONNECT proxy that counts bytes per tunnel; each configuration was run twice, from launch until the browser exited or was stopped after 10 seconds.