Skip to main content

Home › All stories

Headless vs headed browsers for AI agents

The short answerA headless browser runs without a visible window; a headed browser draws one. Most AI browser agents should use Chrome's new headless mode, which is the real browser without the screen. Use headed mode when the agent works from desktop screenshots or a site needs a window.

By · Published · Updated · 5 min read

A headless browser is a web browser that runs without drawing a window. It loads pages, runs JavaScript and keeps cookies like any browser, but nothing appears on a screen, and a program drives it. A headed browser is the ordinary kind, with a visible window that needs a display.

AI agents can use either. The choice changes memory use, what the agent can observe, and how some sites respond.

What changed in Chrome's headless mode?

Chrome's headless mode changed in Chrome 112 from a separate browser implementation to the real browser. The Chrome team describes the old mode as "a separate, alternate browser implementation" that "didn't share any of the Chrome browser code". Then: "In Chrome 112, the Headless mode was updated so that Chrome creates, but doesn't display, any platform windows. All other functions, existing and future, are available with no limitations" (Chrome headless mode docs, read 2026-11-24).

The old implementation did not disappear. "Since Chrome 132.0.6793.0 the old Headless mode is only available as a standalone binary named chrome-headless-shell" (same page). Chrome's announcement adds that running Chrome "with --headless or --headless=new runs the new Headless mode" (Removing old headless from Chrome, published October 23, 2024, read 2026-11-24).

So in 2026 there are three ways to run Chromium for an agent:

Table: The three ways to run Chromium for an agent

ModeWhat it isNeeds a displayNotes
New headless (--headless)The full Chrome browser with windows created but not shownNoSame code paths as headed Chrome
chrome-headless-shellThe old headless implementation, a separate lightweight binaryNoDescribed as more performant for automation that does not need every feature
HeadedThe normal browser with a visible windowYes, a real or virtual displayNeeded for screenshot-of-desktop agents

What do Playwright and Puppeteer use by default?

Playwright and Puppeteer both default to headless, but they pick different headless builds.

  • Playwright "ships a regular Chromium build for headed operations and a separate chromium headless shell for headless mode". You "can opt into the new headless mode by using 'chromium' channel" (Playwright browsers, read 2026-11-24). Its test option headless "Defaults to true" (Playwright test options, read 2026-11-24).
  • Puppeteer says "By default Puppeteer launches the browser in the Headless mode", meaning the new mode, and headless: 'shell' selects chrome-headless-shell. "Before v22, Puppeteer launched the old Headless mode by default" (Puppeteer headless modes, read 2026-11-24).

Playwright's own page warns about the branded browsers' new headless mode: it is "closer to a regular headed mode" and you should "expect different behavior in some cases". That warning applies both ways. If an agent passes in one mode, test it in the other before you switch.

When should an AI agent use headless mode?

An AI agent should use headless mode when it reads the page through the browser itself: the accessibility tree, the DOM or a page screenshot taken by the driver. That covers most browser agents. Headless gives you:

  1. No display server. Nothing to install or keep running beyond the browser.
  2. Lower memory per session. No window compositing for a screen nobody sees.
  3. The same screenshots. page.screenshot() works in headless mode, so a vision model still gets an image of the page.

Pick the new headless mode over chrome-headless-shell when the agent visits arbitrary public sites. It is the real browser, so pages see the same features a normal Chrome has. Pick chrome-headless-shell when the agent only visits known pages and you want the lighter binary.

When should an AI agent use a headed browser?

An AI agent should use a headed browser when it observes a whole desktop rather than a single page, or when a site depends on a visible window.

  • Computer-use agents. An agent that takes screenshots of the screen and moves a mouse needs a real desktop with a window manager. Benchmarks such as OSWorld run a full desktop in a virtual machine for this reason (OSWorld paper, read 2026-11-24).
  • Native dialogs and extensions. File pickers, print dialogs and some extension pop-ups only exist with a window.
  • Live viewing. A person who watches or takes over the session needs something to see. A headed browser on a virtual display can be streamed.
  • Debugging. A visible window shows what the agent is doing in real time.

On a Linux server, a headed browser runs against a virtual display such as Xvfb. That adds a process and some memory per session, which is why it is not the default.

Does headless mode get blocked more often?

Headless mode can be blocked more often on some sites, though less than before. The old headless implementation differed from Chrome in ways sites could test for. The new mode runs the same browser code, so most of those differences are gone. Sites can still see other signals: the automation flags set by drivers, the browser's language and screen settings, and the reputation of the network the request comes from. A headed browser does not change the last two.

The honest approach for an agent is to respect a site's terms and robots rules, and to use an official API where one exists.

How do I switch an agent between headless and headed?

You switch modes with one launch option, and then check two settings that differ between them.

  1. In Playwright, launch with headless: false for headed. For the new headless mode with the full Chromium build, set channel: 'chromium'.
  2. In Puppeteer, headless: true is the new mode, headless: 'shell' is chrome-headless-shell, and headless: false is headed.
  3. Set the viewport size explicitly. Headless and headed defaults differ, and an agent that works from screenshots is sensitive to layout.
  4. On a server, start a virtual display before launching a headed browser.
  5. Run the agent's test tasks in the new mode before changing production.

Which mode is best for a browser sandbox?

For a sandboxed browser agent, new headless mode is the common default: it is the real browser, it needs nothing extra in the container, and it keeps each session small. Move to headed mode for computer-use agents, for human takeover, or for sites that need a window. Whichever you choose, keep Chromium's own sandbox on and run each session in a disposable environment, as described in what a browser sandbox is.

What we read for this article

Frequently asked

What is a headless browser?

A headless browser is a web browser that loads and runs pages without showing a window on a screen. Programs control it through an automation protocol instead of a mouse and keyboard.

Is headless Chrome the same browser as normal Chrome?

Since Chrome 112, the new headless mode is the real Chrome browser with its windows created but not shown. The older, separate implementation now ships as its own binary called chrome-headless-shell.

Is headless faster than headed?

It usually uses less memory and needs no display server. chrome-headless-shell, the old mode, is described by Chrome and Puppeteer as more performant for automation that does not need the full feature set.

Can websites tell that a browser is headless?

Sometimes. The old headless mode differed from Chrome in visible ways. The new mode is much closer to a normal browser, but sites can still look at other signals, such as automation flags and network origin.