The best html2canvas alternative depends on what “screen capture” means. For a screenshot of actual browser-rendered pixels, use Playwright. For turning a DOM node into an image in the user’s browser, compare html-to-image and dom-to-image-more with html2canvas on your own components. For user-authorized sharing of a display or window, use the Screen Capture API. These are different workflows, so no single library is universally better.
First, define the capture you need
html2canvas does not take a native screenshot. It walks the DOM, reads styles and resources, and reconstructs an image. The result can differ from what the browser actually painted when CSS, fonts, images, transforms or embedded documents are difficult to reproduce.
| Requirement | Best starting point | What it produces | Main trade-off |
|---|---|---|---|
| Actual rendered page, full page or element in automation | Playwright | Browser screenshot saved to a file or returned as a buffer | Requires a browser runtime and automation setup |
| DOM node to PNG/JPEG in a client-side app | html-to-image | Generated image from a selected node | CSS, fonts, SVG, image and CORS fidelity must be tested |
| Another client-side DOM-image implementation | dom-to-image-more | Generated image from a selected node | No universal performance or fidelity winner is established; benchmark your fixture |
| User selects a monitor, window or tab to share | Screen Capture API | A permission-controlled MediaStream | It is for sharing or recording, not automatic static element export |
| Keep an existing html2canvas integration | html2canvas | Reconstructed canvas image | Existing options do not remove CSS, origin or canvas-size limits |
Use Playwright for real browser screenshots
Choose Playwright when visual accuracy means the pixels produced by a browser engine. It supports page screenshots, full-page screenshots, element screenshots, file output and buffers. This is usually the clearest replacement for html2canvas in server-side rendering, visual regression, documentation or automated capture.
Install and capture a page
npm install -D playwright
npx playwright install chromium
import { chromium } from 'playwright';
const browser = await chromium.launch();
const page = await browser.newPage({ viewport: { width: 1440, height: 900 }, deviceScaleFactor: 1 });
await page.goto('https://example.com', { waitUntil: 'networkidle' });
await page.screenshot({ path: 'page.png', fullPage: true });
await browser.close();
fullPage: true captures the complete scrollable page. Omit it for the viewport only. To capture one component, locate it and call screenshot on the locator:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#1 Best Overall
- 【1080P HD High Quality】Capture resolution up to 1080p for video source and it is ideal for all HDMI devices such as PS4, PS3, Xbox One, Xbox 360, Wii U, DVDs, DSLR, Camera, Security Camera and set top box. Note: Video input supports 4K30/60Hz and 1080p120/144Hz. Does not support 4K120Hz/144Hz. Output supports up to 2K30Hz.
- 【Plug and Play】No driver or external power supply required, true PnP. Once plugged in, the device is identified automatically as a webcam. Detect input and adjust output automatically. Won't occupy CPU, optional audio capture. No freeze with correct setting.
- 【Compatible with Multiple Systems】suitable for Windows and Mac OS. High speed USB 3.0 technology and superior low latency technology makes it easier for you to transmit live streaming to Twitch, Youtube, Facebook, Twitter, OBS, Potplayer and VLC.
- 【HDMI LOOP-OUT】Based on the high-speed USB 3.0 technology, it can capture one single channel HD HDMI video signal. There is no delay when you are playing game live.
- 【Support Mic-in for Commentary】Rybozen capture card has microphone input and you can use it to add external commentary when playing a game. Please note: it only accepts 3.5mm TRS standard microphone headset.
const card = page.locator('[data-testid="invoice-card"]');
await card.screenshot({ path: 'invoice-card.png' });
Use await page.screenshot() without path when you need a buffer for an upload or response. Wait for the state that matters, not merely a fixed delay: wait for a selector, a font, an application-ready marker or a completed data request. Select the browser, viewport, device scale factor, color scheme and locale explicitly when captures must be reproducible.
Common Playwright readiness pattern
await page.goto(url, { waitUntil: 'domcontentloaded' });
await page.locator('[data-app-ready="true"]').waitFor();
await page.evaluate(() => document.fonts.ready);
await page.screenshot({ path: 'ready.png', animations: 'disabled' });
A browser screenshot still reflects the target page: cookie dialogs, newsletter overlays, chat launchers, bot checks and failed application loads can appear in the output. Hide or dismiss those states deliberately, and treat a challenge page as a capture failure rather than a valid screenshot.
Try html-to-image or dom-to-image-more for client-side DOM export
These projects are designed to generate an image from a DOM node without launching a separate browser automation process. They are reasonable candidates when a user clicks “Export card” inside your web app. Their project descriptions establish the workflow, not a universal ranking over html2canvas, so evaluate them against a representative fixture.
Fixture-based evaluation
- Build a small page containing the hardest parts of your UI: web fonts, inline and external SVG, gradients, shadows, transforms, pseudo-elements, cross-origin images, long content and responsive breakpoints.
- Capture the same node with html2canvas, html-to-image and dom-to-image-more at the output sizes you need.
- Compare text wrapping, font metrics, clipping, transparency, image loading, filters and scroll boundaries in each target browser.
- Repeat with slow network conditions and a missing image. Decide whether the failure should block export or produce a documented fallback.
Do not assume a library supports every CSS feature simply because a browser displays it. DOM-to-image tools serialize and reconstruct content; they do not gain unrestricted access to browser pixels.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesRank #2
- 【1080P 60FPS Video Capture Card】 This HDMI game capture card is based on USB3.0 high speed transmission port, input resolution up to 4K@30HZ, output resolution up to 2K@30Hz or 1920×1080@60Hz. Type c and USB interface can meet most of the devices in daily life. Easily meet the online capture, real-time recording, online meetings, live gaming and other functions, so you have a better visual enjoyment. Note: For capture use only; requires capture software to function and is not intended for direct screen casting to a monitor or TV
- 【Ultra Low Latency Screen Sharing】 HDMI capture card is made of good quality aluminum alloy with strong heat dissipation, allowing you to enjoy ultra low latency while live gaming or video recording or live streaming, avoiding blue screens and lag. This HDMI to USBC capture card supports easy recording of good quality audio or HD video and transferring it to your computer or streaming platform, allowing you to record 60 fps HD video directly on your hard drive and real-time preview
- 【Plug and Play, Easy to Carry】 This HDMI 1080P video capture card does not require any additional drivers or external power supply, just plug and play for fast capture. The capture card is small and lightweight, so you can put it in your bag for emergencies, making it very portable for outdoor live streaming. It's also a great way to share content in game recording, video conference, video recorder and online teaching
- 【Wide Compatibility USB Capture Card】 Easily streams to Facebook, Youtube or Twitch. With the connection, this HDMI to USB C/3.0 video capture devices can be working on several Operating Systems and various software: Windows 7/ 8/ 10, Mac OS or above, Linux, Android, Laptop, Xbox One, PS3/PS4/PS5, Camera, DVDs, Set Top Box, Webcame, DSLR, Switch/Switch 2, TV BOX, HDTV, Potplayer/VLC, ZOOM, OBS Studio etc.
- 【Package Content & Note】 1x HD Audio Capture Card , 1x USB 3.0 to USB C Adapter (A-side 3.0, B-side 2.0), 1x user manual. Please note that you need to restart the OBS Studio software after the audio setup is complete, otherwise it will result in no sound output. When using an adapter, if the device is recognized as USB 2.0, try using the other side with the USB-C port. Simply flip the capture card and reconnect it to be recognized as USB 3.0
When a client-side library is the wrong tool
- Use Playwright when you need the exact rendered page, cross-origin frames, or a controlled server-side workflow.
- Use the Screen Capture API when the user must choose a display surface.
- Keep html2canvas if your current output is acceptable and its options solve your integration needs.
Use the Screen Capture API for user-selected sharing
The Screen Capture API asks the user to select a display, window or browser tab and returns a MediaStream. It is appropriate for screen sharing, recording or live previews, not silent export of a particular DOM element.
const stream = await navigator.mediaDevices.getDisplayMedia({
video: true,
audio: false
});
const video = document.querySelector('video');
video.srcObject = stream;
await video.play();
stream.getVideoTracks()[0].addEventListener('ended', () => {
video.srcObject = null;
});
The call must follow a user gesture and can be rejected when the user cancels or the browser policy disallows the request. Stop tracks when the session ends:
for (const track of stream.getTracks()) track.stop();
html2canvas limits you still need to account for
Cross-origin images and iframes
useCORS: true helps only when the image server supplies compatible CORS headers. A configured proxy is another documented approach. Neither setting grants access to a cross-origin iframe whose document is protected by browser origin rules.
Canvas dimensions and memory
The html2canvas FAQ gives approximate, browser-dependent limits of about 32,767 pixels for a maximum canvas dimension in Chrome/Chromium, Firefox and desktop Safari. It also lists rough maximum areas of approximately 268 megapixels for Chrome/Chromium and 472 megapixels for Firefox. These are estimates from documentation, not fixed guarantees. iOS Safari limits are lower and depend on device memory; an oversized canvas can become blank or partial.
Rank #3
- 4K60 Capture: Record in cinematic quality with crisp detail and vivid colors
- HFR Support: Play and capture in 1440p120 or 1080p240
- HDR10 Support: Capture brilliant HDR content with tone mapping on Windows
- Cross-Platform Compatible: Works with PS5, Xbox Series X/S, Switch 2, and more
- Analog Audio In: Capture in-game chat or commentary with 3.5mm input
Reduce scale, split long pages into sections, limit capture width and height, or use a browser screenshot workflow when the output is larger than a practical canvas.
Useful html2canvas controls
scale, width, height, windowWidth, windowHeight, useCORS, proxy, ignoreElements and onclone can adapt a capture. They adjust bounds, cloning and resource handling; they do not add missing CSS support or bypass origin security.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. One request captures a rendered URL as PNG, JPEG, WebP or PDF without maintaining Playwright infrastructure. Before the capture it accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups and chat widgets; each step can be disabled. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and billing status.
See the ScreenshotNeo documentation for all options, including full-page and element capture, device presets, arbitrary viewports, retina scale, dark mode, lazy-image loading, PDF paper and page-range controls, custom CSS and JavaScript, clicks, selector or network-idle waits, request blocking, headers, cookies, authorization, timezone, geolocation, transparent backgrounds, resizing, TTL caching, signed image links, asynchronous webhooks, bulk capture of up to 100 URLs per call, usage data and OpenAPI compatibility.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
An MCP server provides take_screenshot, get_page_info and capture_pdf tools for Claude, Cursor and other MCP clients. The Free plan includes 1,000 screenshots each month with no card; paid plans start at $5 for 3,000 screenshots. Create a free ScreenshotNeo account.
Rank #4
- High-Quality Video Capture, 4K HDMI Capture Card Ready: Capture smooth and vibrant video with this 4K HDMI capture card, engineered for gamers and content creators who demand crisp 1080P 60FPS video quality. Whether you're streaming to Twitch or recording gameplay for YouTube, your footage will look professional and detailed
- Plug-and-Play USB Capture Card, No Drivers Needed: Designed as a USB capture card for streaming, this device works instantly out of the box, just plug into your PC or laptop and start capturing. Fully compatible with popular software like OBS Studio, Streamlabs, and XSplit, making setup quick and stress-free for beginners and pros alike
- Universal Compatibility PS5, Xbox, Switch & More: Stream or record gameplay from virtually any HDMI-enabled device including Nintendo Switch, PS5, Xbox Series X, DSLR cameras, and PCs. The video capture card for gaming supports seamless passthrough so you can play without lag while your audience watches every frame in real time
- Low-Latency Performance for Smooth Streaming: This capture card for streaming minimizes delay between gameplay and broadcast, so you get reliable, low-latency capture that works well for competitive gaming, live broadcasts, and podcast sessions. Suitable for those building their channel with high-quality, engaging content
- Compact & Portable Design for Content Creators: Lightweight and portable, this USB 3.0 capture card works well for creators who travel or switch gaming setups often. Throw it in your bag and stream or record wherever you are, at home, events, LAN parties, streaming or studio sessions
Troubleshooting by symptom
The image is blank or clipped
- Check canvas dimensions and memory; reduce scale or split the capture.
- Wait for fonts, images and application data before capturing.
- For Playwright, verify the page is not still on a redirect, consent screen or bot challenge.
Images are missing or tainted
- Confirm the image host sends CORS headers and enable
useCORSwhere appropriate. - Use same-origin assets or a controlled proxy.
- Do not expect a client-side library to render a cross-origin iframe document.
The output differs from the visible page
- Use Playwright for browser pixels instead of DOM reconstruction.
- Load the exact web fonts and wait for
document.fonts.ready. - Test transforms, pseudo-elements, filters, SVG and responsive breakpoints in your fixture.
The Screen Capture API fails
- Call
getDisplayMedia()from a user action in a secure context. - Handle cancellation and permission errors.
- Stop every media track when recording or sharing ends.
Decision checklist
- Need browser pixels from a URL or component under automation? Start with Playwright.
- Need a client-side export of a DOM node? Benchmark html-to-image and dom-to-image-more against html2canvas.
- Need the user to choose a screen or window? Use the Screen Capture API.
- Need a hosted URL-to-image or PDF service without browser maintenance? Try ScreenshotNeo first.
- Before shipping, test difficult CSS, fonts, images, iframes, long pages, breakpoints, permissions and failure handling at production dimensions.
Frequently Asked Questions
Can html-to-image capture an entire website URL?
It is intended for generating an image from a DOM node in a page. Use Playwright or a hosted screenshot API for a URL-level browser capture.
Is the Screen Capture API an html2canvas replacement?
No. It captures a user-selected display surface as a MediaStream, while html2canvas and DOM-image libraries export static images from page content.
Should I choose html-to-image or dom-to-image-more?
Neither is established as a universal winner. Run both against the fonts, SVG, images, CSS and dimensions used by your application.
Quick Recap
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.

