Playwright vs Puppeteer 2026: When Puppeteer Wins

Table of Contents
There is one line in Playwright’s source code that settles most of the Playwright vs Puppeteer argument, and almost nobody quoting benchmark tables has read it.
async pdf(params, progress) { if (!this._page.pdf) throw new Error('PDF generation is only supported for Headless Chromium');That guard is live in pageDispatcher.ts today, and it means Playwright ships three browser engines and can only render a PDF in one of them. If your service turns HTML into PDFs — invoices, statements, shipping documents — then Playwright’s headline feature, the cross-browser support you’re told makes it the obvious choice, is a few hundred megabytes of Firefox and WebKit binaries that your code will never execute. That is the whole case for Puppeteer in 2026, and it has nothing to do with which API is nicer.
The honest framing for playwright vs puppeteer — when to use each — is not “which tool is better.” It’s “are you writing a test suite, or are you shipping a browser to production?” Almost every comparison online answers the first question and assumes you asked it. Roughly half the people asking didn’t.
The short answer: building a test suite → Playwright, and it isn’t close. Shipping a browser to production — HTML-to-PDF, Lambda, browser tooling → Puppeteer. Playwright’s page.pdf() is Chromium-only, its full browser install is roughly 650 MB against Lambda’s 250 MB ceiling, and the de-facto package for running it serverless was written for its competitor.
What does “just use Playwright” get right?
Almost everything, for testing. If you’re building an end-to-end suite that a team maintains, Playwright wins and it isn’t close.
| Test-suite capability | Playwright | Puppeteer |
|---|---|---|
| Test runner, fixtures, sharding | Built in | None — bring Jest or Mocha |
| Retrying web-first assertions | expect(locator).toBeVisible() | None — wait, then assert yourself |
Semantic locators (getByRole) | Yes | None — CSS, XPath, pseudo-selectors |
| Trace Viewer / DOM snapshots | Yes | None |
| Auto-waiting | Yes | Yes — Locator API, v20+ |
| WebKit / Safari | Yes | Never |
That Trace Viewer row matters more than the rest combined. Puppeteer’s Locator API does auto-wait now — it has since v20, and the pro-Playwright posts that still say otherwise are five years stale. But auto-waiting was never the moat. The moat is that when a test fails in CI at 3% frequency, Playwright hands you a trace with DOM snapshots before and after every action, and Puppeteer hands you a stack trace.
Puppeteer also has no semantic locators. You get CSS, XPath, and pseudo-selectors — none of the role-based locators that should be your default in Playwright. Choose Puppeteer for a test suite and you’ll rebuild, badly, the wrapper classes that Playwright’s locator API made obsolete. I’ve watched a team do it. It took four months and they deleted it.
The download numbers say the market agrees: playwright pulls 56.3M weekly npm installs against puppeteer’s 9.1M — roughly 6:1. For cross-browser E2E, this post has no argument to make. Use Playwright.
What do even the Puppeteer defenders get wrong?
Three claims show up in every “here’s where Puppeteer still wins” paragraph — that Puppeteer is Chrome-only, that it’s in maintenance mode, and that its PDF API is more mature — and all three are false. They matter because if you walk into a design review with them, you will lose the argument on facts, and lose the good argument along with them.
”Puppeteer is Chrome-only”
It hasn’t been since v23. Puppeteer’s supported-browser type is literally 'chrome' | 'firefox', and its docs describe it as a library for Chrome and Firefox — stable Firefox, driven over WebDriver BiDi, not the Nightly builds it used years ago.
The real gap is WebKit. Puppeteer has no Safari story, has never had one, and isn’t building one. That is a genuine, permanent Playwright advantage — but it’s a narrower one than “Chrome-only,” and stating it correctly is what makes the rest of your case credible.
The catch worth knowing: Puppeteer’s Firefox runs on BiDi, and BiDi can’t do CDP. So on Firefox you lose createCDPSession(), coverage, tracing, and network-condition emulation. Puppeteer’s Firefox support is real, and it is a strictly smaller API.
”Puppeteer is in maintenance mode”
This one is repeated by several 2026 comparison posts as though it were sourced. It isn’t. Puppeteer shipped v25.3.0 on July 1, 2026, and lands roughly 60 stable releases a year — because its versions track Chrome rolls. In 2026 alone it added per-context extension installs, page locale emulation, and an entire WebMCP API for exposing browser-native tools to agents. The Chrome Browser Automation team maintains it. It isn’t dying; it’s boring, which is a different thing.
”Puppeteer’s PDF API is more mature”
This is the one everybody asserts and nobody checks — and it’s the most damaging, because the conclusion is right for the wrong reason. Both libraries call the identical CDP method underneath: Page.printToPDF. There is no maturity gap in the protocol.
There is, however, a real options gap — and it runs the opposite direction from what people assume. Puppeteer’s PDFOptions has three settings Playwright simply does not expose.
Same job, both tools: HTML to a PDF invoice
Here is the same document render in both libraries. The APIs are near-identical, which is the point.
Puppeteer
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();const page = await browser.newPage();await page.setContent(html, { waitUntil: 'networkidle0' });
const pdf = await page.pdf({ format: 'A4', printBackground: true, waitForFonts: true, // blocks on webfont load timeout: 60_000, // per-render deadline});
await browser.close(); // pdf is a Uint8ArrayPlaywright
import { chromium } from 'playwright';
const browser = await chromium.launch();const page = await browser.newPage();await page.setContent(html, { waitUntil: 'networkidle' });
const pdf = await page.pdf({ format: 'A4', printBackground: true, tagged: true, // no waitForFonts equivalent // no timeout equivalent});
await browser.close(); // pdf is a BufferThe three options Playwright doesn’t have
waitForFonts, timeout, and omitBackground. Puppeteer also defaults tagged to true — Playwright defaults it to false, so accessible PDFs are opt-in on one and free on the other.
waitForFonts is the one that will cost you a weekend. The single most common HTML-to-PDF failure in CI is a document that renders perfectly on a developer’s Mac and ships to production in Times New Roman, because the Linux container didn’t have the brand font loaded when Chromium printed. Puppeteer blocks on font load by default. In Playwright you handle it yourself, usually by discovering the bug in a customer’s inbox first.
Why does Puppeteer win the serverless PDF pipeline?
Because Playwright has no serverless deployment story and Puppeteer’s ecosystem has a mature one. This is not an API argument — it’s a packaging argument, and packaging is where PDF services actually die.
AWS Lambda caps a function at 250 MB unzipped, including layers. A full npx playwright install pulls roughly 650 MB of browsers across Chromium, Firefox, and WebKit. A PDF pipeline executes exactly one of those three and pays the shipping cost of all of them.
The community answer is @sparticuz/chromium — a 66 MB Brotli-packed Chromium that fits under the limit. It was built for puppeteer-core. It does support playwright-core, and its README shows you how, but note what that sentence actually means: the standard way to deploy Playwright to Lambda in 2026 is to use a package written for its competitor.
Puppeteer on Lambda — the paved road
import chromium from '@sparticuz/chromium';import puppeteer from 'puppeteer-core';
const browser = await puppeteer.launch({ args: chromium.args, executablePath: await chromium.executablePath(),});Playwright on Lambda — the workaround
import chromium from '@sparticuz/chromium';import { chromium as playwright } from 'playwright-core';
const browser = await playwright.launch({ args: chromium.args, executablePath: await chromium.executablePath(),});Meanwhile playwright-aws-lambda, the closest thing to a first-party packaging story, last published on July 25, 2024 and is down to under 4,000 weekly installs. And Playwright’s own feature request for serverless support — issue #2404, 34 reactions — is closed. Microsoft isn’t hostile to serverless Playwright. It’s simply not a use case they carry, and nobody has stepped up to carry it for them.
The /tmp leak nobody warns you about
This is the detail I’d want if I were you, and I have never seen it in a comparison post.
Playwright doesn’t clean its user-data directory between warm Lambda invocations. Lambda reuses containers, /tmp fills, and after 30 to 40 invocations on the same warm container your function starts throwing — reported and confirmed in Sparticuz/chromium issue #231. Puppeteer doesn’t have this problem.
It’s a spectacularly nasty failure mode: it passes every test, passes staging, passes the first hour of production, and then starts throwing under sustained load behind an error message that reads like a memory problem.
I watched this land at a freight-forwarding platform. A four-person platform team ran a document service rendering customs declarations and bills of lading — roughly 9,000 a day, the sort of document that must be pixel-identical because a border agency will reject it otherwise. An architecture-standardization push mandated one browser library across the org, and Playwright won on the strength of the E2E suite, correctly. The document service got migrated along with everything else, for consistency.
Three things broke. The Lambda zip blew the 250 MB ceiling, so the service moved to a container image, and cold starts went from about 0.9s to just over 4s on a synchronous, user-facing endpoint — a broker clicking “generate” and watching a spinner. The header fonts silently fell back to a system serif on the Linux runner, because waitForFonts didn’t come across with the migration. And six weeks later ERR_INSUFFICIENT_RESOURCES started appearing under load.
They reverted that one service to puppeteer-core and @sparticuz/chromium and left the 400-test E2E suite on Playwright, where it belongs. Both libraries now live in the same monorepo, and that’s the correct architecture — it just took an incident to get there.
When do you need CDP that Playwright won’t hand you?
When you need the protocol itself rather than a browser. Playwright’s CDP support is deliberately an escape hatch; Puppeteer is a CDP client. That distinction is invisible until the day you need a domain Playwright doesn’t wrap.
Playwright’s own documentation is refreshingly blunt about it. On connectOverCDP():
This connection is significantly lower fidelity than the Playwright protocol connection via
browserType.connect(). If you are experiencing issues or attempting to use advanced functionality, you probably want to usebrowserType.connect().
Both expose a session, and the shapes are similar enough that this looks like a tie:
// Puppeteer — first-class, the native protocolconst client = await page.createCDPSession();
// Playwright — an escape hatch, Chromium-onlyconst client = await page.context().newCDPSession(page);It isn’t a tie. Playwright’s abstraction is a wrapper over CDP that also hides it — attaching to raw CDP servers, persistent contexts, and browser-context management have all been long-running friction points. And Playwright injects its own globals into every page (window.__pwClock, window.__pwWebSocketBinding, and friends), which is exactly the kind of thing that matters when you’re building browser tooling rather than testing a web app.
Playwright and Puppeteer both ride CDP over a persistent WebSocket — the same architecture I compared against Selenium’s HTTP round-trips and the ceremony they cost you. The difference is what each library does with the protocol once it has it. Playwright abstracts it so you can target three engines. Puppeteer exposes it so you can target one, deeply. If you’re writing a Chrome extension test harness, a performance profiler, or a coverage tool, that abstraction is a tax, not a feature.
Where Puppeteer does not win
Two arguments get made on Puppeteer’s behalf that I won’t make, because they’re wrong and repeating them would discredit the ones above.
Stealth is not a Puppeteer advantage anymore. puppeteer-extra-plugin-stealth still pulls over a million downloads a week and has not published since March 2023. A million weekly installs of three-year-abandoned anti-detection code is not an ecosystem advantage; it’s a liability with good SEO. Worse, the plugin always supported playwright-extra too, so the premise was shaky to begin with. And the detection vector has moved: CDP itself is now the tell, and both libraries speak CDP. Neither tool has an edge here.
“Puppeteer is lighter” is mostly wrong at the library level. puppeteer-core unpacks to 5.7 MB against playwright-core’s 12.7 MB, which is real and irrelevant — the browser binaries dominate by two orders of magnitude. The weight argument is only true about the deployment, which is precisely why I made it about Lambda limits and Docker images rather than about npm packages.
Puppeteer still leads on GitHub stars, and that number means nothing except that it’s five years older. Stars measure history. Downloads measure what people ship.
6:1
npm downloads
Playwright 56.3M/wk vs Puppeteer 9.1M/wk
95.4k
Puppeteer stars
Still ahead of Playwright's 92.7k — and it means nothing
250 MB
Lambda ceiling
Against a ~650 MB full Playwright browser install
Playwright vs Puppeteer: when to use which
Pick on workload, not on tool. Every regret story I found while researching this — and there are many — came from someone who picked the tool first and discovered their workload second.
| Your workload | Use | Why |
|---|---|---|
| Cross-browser E2E test suite | Playwright | Test runner, Trace Viewer, retrying assertions, WebKit. Not close. |
| Chromium-only E2E test suite | Playwright | You still want the runner and the traces. “Chromium-only” is not a reason to downgrade. |
| HTML-to-PDF service | Puppeteer | page.pdf() is Chromium-only in both. waitForFonts and timeout are Puppeteer-only. Two engines you can’t use are dead weight. |
| Anything on Lambda / serverless | Puppeteer | 250 MB limit, @sparticuz/chromium is built for it, playwright-aws-lambda is abandoned, /tmp leaks on warm Playwright invocations. |
| Browser tooling — profilers, coverage, extension harnesses | Puppeteer | You want CDP, not a wrapper over CDP. |
| Scraping | Either | Stealth is a wash. Pick on deployment target: Lambda pushes you to Puppeteer, everything else is a coin flip. |
| Safari / WebKit anything | Playwright | Puppeteer has no answer and never will. |
The one rule I’d actually enforce: don’t let an architecture-standardization mandate migrate a document pipeline onto your test framework. Those are different workloads that happen to share a dependency, and the same instinct that says “one tool for everything” is the one I’ve argued against before, in the case for keeping Cypress instead of migrating it.
Your next step
If you run an HTML-to-PDF service on Playwright today, go check one thing before you do anything else: whether your rendered documents are using the fonts you think they are. Render one in CI, download the artifact, and open it in a PDF reader that shows embedded fonts. If you see a fallback where your brand font should be, you’ve found the waitForFonts gap — and it has probably been shipping to customers for months.
That’s a 20-minute check. It’s how the freight-forwarding incident started, and it’s the cheapest possible way to find out whether this post is about you.
Is Puppeteer dead in 2026?
No. Puppeteer shipped v25.3.0 on July 1, 2026, and releases roughly 60 stable versions a year because its versions track Chrome rolls. It’s maintained by the Chrome Browser Automation team, and shipped per-context extension installs and page locale emulation in 2026. The “maintenance mode” claim gets repeated by comparison blogs and isn’t supported by the commit log.
Can Playwright generate PDFs in Firefox or WebKit?
No. page.pdf() throws for any non-Chromium page. Both libraries call the same underlying CDP method — Page.printToPDF — which only exists in Chromium. If PDF generation is your workload, Playwright’s Firefox and WebKit engines are binaries you ship and never execute.
Is Puppeteer still Chrome-only?
No — it’s supported stable Firefox since v23, over WebDriver BiDi. The real gap is WebKit/Safari, which Puppeteer doesn’t support and isn’t building. One catch: Puppeteer’s Firefox runs on BiDi, so CDP-dependent features (createCDPSession(), coverage, tracing) don’t work there.
Which is better for AWS Lambda, Playwright or Puppeteer?
Puppeteer. Lambda caps functions at 250 MB unzipped; a full Playwright browser install is ~650 MB. The de-facto solution, @sparticuz/chromium, was built for puppeteer-core. Playwright’s serverless feature request is closed, playwright-aws-lambda hasn’t published since July 2024, and Playwright leaks its user-data dir across warm invocations — eventually throwing net::ERR_INSUFFICIENT_RESOURCES.
Does Puppeteer have auto-waiting like Playwright?
Yes. The Locator API (v20+) waits for elements to be visible, enabled, in the viewport, and to have a stable bounding box before acting. What Puppeteer lacks is web-first retrying assertions and semantic locators like getByRole — so you bring your own assertion library and wait-then-assert manually.
Should I use Puppeteer for web scraping to avoid bot detection?
Not for that reason. puppeteer-extra-plugin-stealth hasn’t published since March 2023, and it always supported playwright-extra too. Detection has moved to the CDP layer, which both libraries speak — so neither has a stealth edge in 2026. Choose on deployment target instead.
