Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Call await page.screenshot() without a path option. In Node.js, Playwright returns a Buffer containing the screenshot bytes, so you can encode, upload, process, or compare the image without writing an intermediate file.

Capture a screenshot directly into a Buffer

With Playwright’s JavaScript API, the return value of page.screenshot() is a Promise<Buffer>. Await it to get the image bytes:

const screenshotBuffer = await page.screenshot();

Do not provide path if you want the result kept in memory. Providing path, as in page.screenshot({ path: 'screenshot.png' }), tells Playwright to write the screenshot to a file. The official Page API reference documents the Buffer return and screenshot options; the screenshots guide shows the in-memory pattern and its use for post-processing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Complete Node.js example

This ES module example opens a page, captures a PNG Buffer, reports its length, prints a base64 representation, and closes the browser even if navigation or capture fails:

#1 Best Overall
Sale
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
import { chromium } from 'playwright';

const browser = await chromium.launch();
try {
  const page = await browser.newPage();
  await page.goto('https://example.com');

  const screenshotBuffer = await page.screenshot();
  console.log('Bytes:', screenshotBuffer.length);
  console.log('Base64:', screenshotBuffer.toString('base64'));
} finally {
  await browser.close();
}

The returned Buffer is the image itself, not a file path. Pass it directly to a library or API that accepts binary data. For an upload, follow the receiving service’s expected content type and request format; do not base64-encode unless that service expects text encoding.

Choose the capture area and image settings

The screenshot method accepts options that affect what pixels are captured and how they are represented. These options control the bytes returned; they do not require saving a file.

Need Option or method Effect
Capture beyond the visible viewport fullPage: true Captures the full scrollable page.
Capture a particular element page.locator(selector).screenshot() Returns a Buffer for the element screenshot.
Choose image type type: 'png' or type: 'jpeg' PNG is the default. JPEG is available when you want lossy compression.
Set JPEG quality quality Controls JPEG quality; it does not apply to PNG.
Capture a rectangle clip Limits the capture to the specified rectangle.
Cover sensitive or unstable content mask and maskColor Masks selected locators in the screenshot.
Use a transparent background omitBackground: true Enables transparency for image formats that support it.
Control output pixel scale scale: 'css' or scale: 'device' Chooses CSS-pixel or device-pixel output; the default is 'device'.
Reduce animation-driven differences animations: 'disabled' Disables animations and transitions for the capture.

Full-page Buffer

const fullPageBuffer = await page.screenshot({ fullPage: true });

This still returns a Buffer because no path is supplied. Full-page captures are useful when the page content extends below the viewport; for long pages, consider the resulting image dimensions and whether the downstream consumer accepts them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Element Buffer

const headerBuffer = await page.locator('.header').screenshot();

Replace .header with a selector for the element you need. The locator screenshot is also an in-memory result when you omit path. If the element is not present or cannot be captured, check the selector and page state before changing image options.

Combine options when needed

const stableBuffer = await page.screenshot({
  fullPage: true,
  type: 'jpeg',
  quality: 85,
  animations: 'disabled',
  scale: 'css'
});

Use only settings that suit the intended consumer. JPEG quality has no effect on PNG, transparency is format-dependent, and device-pixel output can be larger than CSS-pixel output. For visual comparisons, deterministic capture settings are often more useful than maximizing image detail.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

Send, encode, or process the Buffer

Convert to base64

Node.js Buffers can be encoded without creating a file:

const base64 = screenshotBuffer.toString('base64');

Base64 is useful when an interface specifically needs text, such as a JSON field or data URL. It increases the representation size compared with the underlying binary data, so prefer raw bytes for upload endpoints that accept binary bodies.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Pass bytes to another service

For an HTTP endpoint accepting a raw PNG body, a Node.js request can send the Buffer directly. Set the content type to match the format actually captured and use the endpoint’s required authentication and URL:

const upload = await fetch('https://service.example/upload', {
  method: 'POST',
  headers: { 'Content-Type': 'image/png' },
  body: screenshotBuffer
});

if (!upload.ok) {
  throw new Error(`Upload failed: ${upload.status} ${upload.statusText}`);
}

This is a generic transport example, not a claim about a particular service’s API. If you captured JPEG, use image/jpeg; if the service expects multipart form data or base64 JSON, construct that format instead.

Use the bytes in Python or Java

Playwright’s Python API returns screenshot bytes:

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.
screenshot_bytes = await page.screenshot()

To encode those bytes as base64 in Python:

import base64

encoded = base64.b64encode(screenshot_bytes).decode('ascii')

In Java, the corresponding screenshot result is a byte[], and the official guide shows encoding it with Base64.getEncoder().encodeToString(buffer). See the official screenshots guide for the language examples.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a Buffer for visual regression

Playwright’s snapshot assertions accept a screenshot Buffer directly, allowing a test to capture and compare an image without a separate save step:

expect(await page.screenshot()).toMatchSnapshot('landing-page.png');

The assertion compares the Buffer with the expected snapshot. The snapshot assertions documentation notes that these matching APIs are intended for the Playwright test runner. If you are using another test framework, confirm that its comparison library accepts Buffer input or convert the bytes to the input format it requires.

Make comparisons more repeatable

  • Capture the same viewport or element each time.
  • Disable animations with animations: 'disabled' when motion makes images vary.
  • Mask dynamic regions such as timestamps, rotating content, or user-specific details.
  • Keep image type and scale consistent across runs.
  • Wait for the page’s relevant content to be ready before capture; a screenshot taken before rendering settles may differ even when the code is unchanged.

These controls reduce avoidable variation; they do not make inherently dynamic content identical. Snapshot updates should be reviewed as image changes, not accepted automatically just because a test reports a mismatch.

Choose between a file and in-memory output

The two workflows serve different consumers:

Workflow Use it when What to consider
Buffer: await page.screenshot() You will upload, encode, transform, or compare the image in the same process. No intermediate file is needed. The image remains in memory until your code releases its references.
File: await page.screenshot({ path: 'screenshot.png' }) A later tool or person needs a named image on disk. You must manage the output path, file access, and cleanup as appropriate.

For an in-memory pipeline, keep the Buffer in binary form as long as possible. Convert to base64 only when required, and avoid retaining many large screenshots at once if your process captures pages in bulk.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Or skip the browser setup

If you need a screenshot from a URL rather than a Playwright-controlled browser session, ScreenshotNeo is a website screenshot API and MCP server. A GET request returns an image or PDF; the API supports PNG, JPEG, or WebP output. The result is an HTTP response body rather than a Playwright Buffer.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options and response details. Cookie and consent banners are accepted like a visitor and removed along with supported newsletter popups and chat widgets before capture; those cleanup steps can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month without a card.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common problems

The screenshot is written to disk instead of returned as bytes

Check whether your options include path. Remove it to keep the result in memory, or keep it only when you intentionally need a file. Store the awaited return value to use the Buffer:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const screenshotBuffer = await page.screenshot();

The value is a Promise, not a Buffer

page.screenshot() is asynchronous. If you omit await, you have a Promise and cannot use Buffer methods such as .toString('base64') or .length as intended. Await the call inside an async function or use top-level await in a supported ES module.

The image is blank or incomplete

Confirm navigation has completed and that the content you need has rendered before taking the screenshot. For lazy-loaded content, a viewport capture may not include elements outside the visible area; use fullPage: true when the goal is the full scrollable page. A full-page option does not by itself guarantee that application data or third-party content has finished loading.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

The Buffer is unexpectedly large

Check the capture area and scale. A full-page image or scale: 'device' can produce more pixels than a viewport capture at CSS scale. If the output consumer permits it, choose JPEG and an appropriate quality; quality is not a PNG setting. Releasing references to Buffers you no longer need also lets the runtime reclaim memory.

The visual snapshot changes between runs

Check for animation, dynamic text, changing data, and inconsistent viewport or scale. Use animations: 'disabled' and mask known variable regions. Ensure the same route and page state are captured each time, and review snapshot diffs before updating expected images.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Base64 output is rejected by an API

Verify whether the endpoint expects raw binary, multipart form data, or a base64 string. Base64 text is not interchangeable with an image body. If it expects raw bytes, send the Buffer and the matching image content type; if it requires JSON, follow its encoding and field-name requirements.

Frequently asked questions

Does a Playwright screenshot Buffer include image metadata?

The cited API documentation establishes that the result is a Buffer of the captured screenshot; it does not specify metadata guarantees for every format or downstream transformation. Check the image-processing library or service you use if metadata preservation matters.

Can I use a Buffer with any visual-diff package?

Not automatically. Playwright’s test-runner snapshot assertions accept Buffers, but other packages may require a path, decoded pixels, or a specific image object. Check the comparison tool’s input contract before choosing the handoff format.

Is PNG always the best choice?

PNG is Playwright’s default and is useful when lossless output matters. JPEG offers a quality option for lossy compression. Choose according to image content and the downstream tool’s supported formats.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.