Recommended Free Tools
For an in-page “screenshot of a div,” use html2canvas and pass it the element you want to capture. The library returns a canvas that you can download as PNG, JPEG, or another browser-supported format. It redraws the DOM rather than recording the browser’s actual pixels, so unsupported CSS, cross-origin images, and embedded documents can differ from what is visible on screen.
If you need pixels from a real display or browser tab, use getDisplayMedia() with the user’s permission, then optionally apply Element Capture or Region Capture where the target browser supports those APIs.
Capture one element with html2canvas
Load html2canvas, select the target DOM node, render it, and export the resulting canvas. The selector must identify the element itself, not a jQuery collection.
Complete browser example
<button id="save-shot" type="button">Download panel</button>
<section id="capture" class="card">
<h2>Monthly report</h2>
<p>This panel is the area that will be rendered.</p>
</section>
<script src="https://cdn.jsdelivr.net/npm/html2canvas@1.4.1/dist/html2canvas.min.js"></script>
<script>
document.querySelector('#save-shot').addEventListener('click', async () => {
const element = document.querySelector('#capture');
if (!element) throw new Error('The #capture element was not found');
const canvas = await html2canvas(element, {
scale: window.devicePixelRatio,
backgroundColor: null
});
canvas.toBlob(blob => {
if (!blob) throw new Error('The browser could not encode the canvas');
const link = document.createElement('a');
link.download = 'capture.png';
link.href = URL.createObjectURL(blob);
link.click();
URL.revokeObjectURL(link.href);
}, 'image/png');
});
</script>
toBlob() avoids creating a potentially very large base64 string. For a quick data URL, use canvas.toDataURL('image/png') instead. JPEG and WebP are also possible when the browser supports the requested MIME type:
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware match#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
const jpeg = canvas.toDataURL('image/jpeg', 0.9);
const webp = canvas.toDataURL('image/webp', 0.9);
Wait for fonts, images, or application state
Render only after the content is in its final state. Await document.fonts.ready, and wait for important images before calling html2canvas:
await document.fonts.ready;
await Promise.all([...document.images].map(img => {
if (img.complete) return Promise.resolve();
return new Promise(resolve => {
img.addEventListener('load', resolve, { once: true });
img.addEventListener('error', resolve, { once: true });
});
}));
const canvas = await html2canvas(document.querySelector('#capture'));
For a single-page application, trigger capture after the component has rendered and after any loading indicator has disappeared. A fixed element, sticky header, or animation can otherwise produce a different result on each call.
Using jQuery
jQuery returns a collection. html2canvas expects a native HTMLElement, so use index 0 (or .get(0)):
$('#save-shot').on('click', function () {
const element = $('#capture')[0];
if (!element) return;
html2canvas(element, { scale: window.devicePixelRatio }).then(function (canvas) {
const link = document.createElement('a');
link.download = 'capture.png';
link.href = canvas.toDataURL('image/png');
link.click();
});
});
Passing $('#capture') directly fails because it is not the DOM node html2canvas is designed to render.
Crop coordinates, size, and high-DPI output
The element argument defines the normal capture area. You can also provide crop coordinates and dimensions:
const canvas = await html2canvas(document.body, {
x: 100,
y: 200,
width: 800,
height: 500,
scale: window.devicePixelRatio
});
Crop values are interpreted in the library’s rendered capture coordinate system. Scroll position, transforms, fixed positioning, and responsive breakpoints can affect the result, so validate coordinates at the viewport sizes you support. scale: window.devicePixelRatio creates sharper output on a Retina or other high-density display but increases memory use and encoding time. If a very large page causes memory pressure, choose a lower scale such as 1, reduce the capture dimensions, or capture several sections.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
What html2canvas can and cannot reproduce
It redraws the DOM
html2canvas walks the document and reconstructs supported styles in a canvas. It does not ask the browser for a literal screenshot. CSS properties that the project does not implement, browser-native controls, video frames, filters, complex blend modes, and some pseudo-elements may be missing or visually different. Test the exact components, fonts, and browser versions used by your application.
Exclude controls or sensitive content
Add data-html2canvas-ignore to nodes that should not appear:
Free tools Windows power users keep installed
One-click scans. No signup required.
<button data-html2canvas-ignore>Close</button>
You can also exclude nodes with an ignoreElements callback:
const canvas = await html2canvas(element, {
ignoreElements: node => node.matches('.no-print, [aria-hidden="true"]')
});
Images and canvas security
Images loaded from another origin need appropriate CORS cooperation or an authorized same-origin proxy. useCORS: true asks html2canvas to request images with CORS; it does not bypass the browser’s same-origin policy:
const canvas = await html2canvas(element, {
useCORS: true
});
The image server must send a compatible Access-Control-Allow-Origin response, and the image must be requested in a way that permits CORS. If a foreign image taints the canvas, reading it with toDataURL() or toBlob() throws a security error. Removing the image, serving it from your origin, configuring CORS, or using an authorized proxy are the valid fixes.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Cross-origin iframes
html2canvas cannot inspect the document inside a cross-origin iframe. You may capture the iframe’s visible box as part of a browser-level screen capture, but you cannot recursively read its DOM from the parent page. If you control both origins, use a cooperating message-based design and capture the content in the frame’s own document.
When a real screen capture is the better choice
Use the Screen Capture API when you need pixels from a display, window, or tab rather than a DOM reconstruction. Calling navigator.mediaDevices.getDisplayMedia() opens a browser-controlled chooser and returns a MediaStream after the user selects a surface.
Capture a selected surface and grab one frame
async function captureSelectedSurface() {
if (!navigator.mediaDevices?.getDisplayMedia) {
throw new Error('Screen capture is not available in this browser');
}
const stream = await navigator.mediaDevices.getDisplayMedia({
video: true,
audio: false
});
try {
const track = stream.getVideoTracks()[0];
const imageCapture = new ImageCapture(track);
const bitmap = await imageCapture.grabFrame();
const canvas = document.createElement('canvas');
canvas.width = bitmap.width;
canvas.height = bitmap.height;
canvas.getContext('2d').drawImage(bitmap, 0, 0);
canvas.toBlob(blob => {
if (!blob) return;
const link = document.createElement('a');
link.download = 'screen-frame.png';
link.href = URL.createObjectURL(blob);
link.click();
URL.revokeObjectURL(link.href);
}, 'image/png');
} finally {
stream.getTracks().forEach(track => track.stop());
}
}
document.querySelector('#screen-shot').addEventListener('click', captureSelectedSurface);
Call this from a click or another transient user activation. Browsers do not allow a page to silently select an arbitrary display surface, and permission cannot be assumed to persist for unattended later captures. The Screen Capture and ImageCapture interfaces have limited, browser-dependent availability; check the target browser’s current compatibility before shipping.
Element Capture versus Region Capture
These APIs operate on an already authorized captured stream; neither silently bypasses the chooser.
- Element Capture: creates a restriction target from an element and limits the stream to that element’s DOM tree and descendants. The target must satisfy additional CSS eligibility requirements.
- Region Capture: creates a crop target from an element’s bounding rectangle. Overlapping content can remain visible because the operation is geometric cropping, not DOM isolation.
Where supported, the shape is:
const stream = await navigator.mediaDevices.getDisplayMedia({ video: true });
const track = stream.getVideoTracks()[0];
const element = document.querySelector('#capture');
// Element Capture (support and eligibility vary)
const restriction = await RestrictionTarget.fromElement(element);
await track.restrictTo(restriction);
// Or Region Capture
const crop = await CropTarget.fromElement(element);
await track.cropTo(crop);
Do not present these as universal replacements for html2canvas. Verify support and behavior in the browser versions your users actually run.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Choosing the right method
| Requirement | html2canvas | Screen Capture APIs |
|---|---|---|
| Automatic, no chooser | Yes, for DOM your page can access | No; user activation and selection are required |
| Pixel fidelity | Redraw of supported DOM and CSS | Pixels from an authorized display stream |
| Cross-origin iframe content | Cannot inspect its document | Can appear when the selected surface includes it |
| Targeting | Element argument or crop options | Element restriction or geometric region crop where supported |
| Automation suitability | Good for app-controlled exports | Interactive by design; browser support varies |
Choose html2canvas for downloadable cards, invoices, charts, previews, and other content your page owns. Choose native capture when visual fidelity to a selected tab or window matters more than automation and permission friction.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshooting
The output is blank or only partly rendered
- Confirm the selector returns one visible element and that its dimensions are nonzero.
- Wait for fonts, images, data, and animations to settle before rendering.
- Check that the element is not hidden by
display: none, collapsed parents, or a zero-sized transform. - For a long page, capture the element rather than a clipped scrolling wrapper, or adjust the wrapper’s dimensions deliberately.
Styles, shadows, or icons differ
This is expected when a CSS feature is outside html2canvas’s implemented coverage. Replace unsupported effects with simpler styles for export, or use a browser-level capture when exact pixels are essential.
“Tainted canvases may not be exported”
Find every external image, background image, SVG, or nested canvas in the target. Serve assets with CORS headers, move them to the same origin, use an authorized proxy, or omit them. useCORS: true helps only when the server cooperates.
The iframe is missing
A cross-origin iframe cannot be read by html2canvas. Capture the iframe application from its own origin, arrange cooperation between documents, or use an authorized screen capture of the tab/window.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsgetDisplayMedia() throws an error
- NotAllowedError: the call was not made from a user gesture, the user cancelled, or policy/permission blocked capture. Start it from a visible button and handle cancellation.
- NotSupportedError: the browser or requested constraints are unavailable. Test the actual browser matrix and simplify constraints.
- SecurityError: the document’s security policy or browser settings prohibit capture. Review Permissions Policy and embedding context.
- AbortError: the chooser or capture ended before a stream was returned. Treat it as a normal cancellation path.
Always stop tracks when finished. Leaving a track running can keep the browser’s capture indicator active and waste resources.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
High-DPI capture uses too much memory
Canvas memory grows with width × height × scale². Lower scale, capture smaller regions, or encode and release each canvas promptly. Avoid converting very large canvases to data URLs when a Blob download is sufficient.
Or skip the browser setup
For server-side screenshots, ScreenshotNeo captures a URL with one request and can return PNG, JPEG, WebP, or PDF. It accepts the cookie or consent banner like a visitor, then removes more than 60 known consent platforms, newsletter popups, and chat widgets before the capture; each cleanup step can be disabled. Only clean shots are billed: bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and billing status.
cURL
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)
Node.js
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const fs = await import('node:fs/promises');
await fs.writeFile('shot.webp', Buffer.from(await res.arrayBuffer()));
See the ScreenshotNeo documentation for authentication and the full option set. It supports full-page captures with lazy images loaded, CSS-selector element capture, dark mode, device presets and custom viewports, Retina scale, PDF controls, custom CSS and JavaScript, pre-capture clicks, selector waits, delays and network-idle waits, ad/tracker/request blocking, headers, cookies, user agents, Authorization, timezone, geolocation, transparent backgrounds, resizing, chosen cache TTLs, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification. Parameter names used by other screenshot APIs also work, which can simplify migration.
ScreenshotNeo also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 shots each month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account to try it without a card.
Frequently Asked Questions
Can html2canvas capture an element that extends beyond the viewport?
Usually, yes: pass the element rather than relying on the visible viewport, and ensure its layout has a real height. Very large canvases may require a lower scale or smaller sections to avoid memory limits.
Can I capture a canvas drawn from another website?
Only if the resource and drawing pipeline satisfy browser same-origin and CORS rules. Otherwise the canvas may be tainted and cannot be exported.
Can a script take a screen capture without showing a permission dialog?
No. getDisplayMedia is designed around a user-selected surface and transient user activation; a page cannot silently choose an arbitrary display.
Should I use a data URL or Blob for downloads?
Use a Blob for large images because it avoids duplicating the entire file in a base64 string. Data URLs are convenient for small, immediate previews.
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.

