Recommended Free Tools
To convert HTML to a screenshot, first render it in a browser engine, then capture the rendered page as an image. You can run that browser yourself with Playwright, or send the page to a hosted screenshot API. Use Playwright when you need direct control over the browser; use a hosted API when you want to avoid operating browser processes in your application.
What an HTML screenshot API actually does
HTML is markup, not a finished image. The browser loads the markup, applies CSS, runs JavaScript, fetches resources such as fonts and images, and lays out the resulting page. A screenshot captures that rendered output. Cloudflare describes its screenshot endpoint as processing HTML and JavaScript before capture (Cloudflare Browser Run screenshot endpoint).
This distinction affects what you send to an API. Some services accept a URL and visit the page; some also accept raw HTML; others expose a browser automation interface. Check the specific endpoint’s input contract rather than assuming that every screenshot API accepts an HTML string or returns the same kind of result.
Option 1: Render and capture HTML with Playwright
Playwright gives your application control of a browser. The general flow is to launch it, create a page, load a URL or your generated HTML, wait for the state your capture needs, take a screenshot, and close the browser. Install Playwright and its browser binaries as described in the Playwright installation guide.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#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.
Capture a page by URL with Node.js
This runnable example captures a full-page PNG and writes it to disk. It uses a URL as the page input, which is useful when the HTML is already served by your application.
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
try {
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
await page.goto('https://example.com', { waitUntil: 'networkidle' });
await page.screenshot({ path: 'page.png', fullPage: true, type: 'png' });
} finally {
await browser.close();
}
})();
Save the file as screenshot.js and run node screenshot.js in a project where Playwright is installed. The networkidle condition can be useful for pages whose content loads through requests, but it is not a universal definition of “ready.” Analytics, polling, ads, or other persistent network activity can prevent a page from reaching it. For dynamic pages, wait for a meaningful selector or application-specific ready signal instead.
Render HTML generated in your application
If you have an HTML string rather than a URL, load it into the browser page before capturing. One practical approach is page.setContent(), followed by a wait for the element or state that indicates rendering is complete:
const { chromium } = require('playwright');
(async () => {
const html = `<!doctype html>
<html><head><meta charset="utf-8">
<style>body { font: 18px sans-serif; padding: 32px; }</style>
</head><body>
<main id="report"><h1>Monthly report</h1><p>Rendered in a browser.</p></main>
</body></html>`;
const browser = await chromium.launch();
try {
const page = await browser.newPage({ viewport: { width: 1200, height: 800 } });
await page.setContent(html, { waitUntil: 'load' });
await page.locator('#report').waitFor({ state: 'visible' });
await page.screenshot({ path: 'report.png', fullPage: true, type: 'png' });
} finally {
await browser.close();
}
})();
For a real app, external stylesheets, image URLs, web fonts, and scripts must be reachable from the browser process. HTML that references local assets may need a served origin or appropriately configured paths; a browser running in a container may not see files on the host unless they are mounted or served.
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.
Choose the capture area and image output
Playwright’s screenshot API supports viewport capture by default, full-page capture, clipping to a rectangle, and output as a file or buffer. A buffer is useful when your application will upload the image or return it from an API rather than writing it to local disk. The Playwright screenshots guide documents basic, full-page, buffer, and element screenshot patterns, and the Page API reference covers its options.
- Viewport: omit
fullPageto capture the visible viewport at the page’s configured size. - Full page: set
fullPage: truewhen the output should include content below the fold. Very long pages can produce large images and consume more memory. - Element: use a locator’s screenshot method when only a chart, card, or other element is needed.
- Clip: specify a rectangle when you need an exact region of the page.
- Format and quality: choose a supported image type such as PNG or JPEG. Quality is relevant to lossy formats; verify the API’s supported options for the Playwright version you install.
- Buffer: capture bytes in memory when another service or response handler will consume the image.
The Playwright screenshots guide notes that its “Screenshots API accepts many parameters for image format, clip area, quality, etc.”
Option 2: Use a hosted screenshot API
A hosted service runs the rendering browser outside your application. Your code makes an HTTP request, and the provider handles browser execution and returns a result according to its API contract. This reduces the browser-operation work in your service, but it makes you dependent on the provider’s accepted inputs, limits, authentication requirements, and response format.
Check the input and response contract
ScreenshotAPI documents both URL and raw HTML input through a POST request and says the response body contains binary image data (ScreenshotAPI screenshot API documentation). Cloudflare Browser Run documents a /screenshot endpoint that renders a page’s HTML and JavaScript before capturing it. These are provider-specific details, not a universal contract. For another vendor, verify the current endpoint documentation for the request method, how HTML is supplied, authentication, output format, and whether the response is image bytes or a URL.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteRank #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.
For comparison, Screenshot API’s REST documentation provides an API-key example at Screenshot API Documentation. That does not establish the same inputs or output behavior as ScreenshotAPI or Cloudflare; read the documentation for the exact service and endpoint you plan to use.
When to choose hosted rendering
- Choose a hosted API if you do not want your own application to launch, update, and monitor browser processes.
- Choose Playwright if browser-level control, custom execution, or keeping the rendering workflow inside your infrastructure matters more than operating that browser yourself.
- For either route, compare accepted inputs, full-page and element capture, formats, viewport and scale settings, authentication, request limits, data handling, and current pricing.
The cited documentation establishes implementation and feature differences, not a consistent speed, reliability, or cost comparison. There is no basis here to say one approach is always faster or cheaper; the result depends on the workload and the services or infrastructure involved.
Capture decisions that affect the result
Set the capture requirements before wiring an endpoint into production. A screenshot can be valid bytes but still be the wrong screenshot if the page is captured too early, at the wrong size, or with the wrong extent.
- Viewport or whole document: a viewport shot represents what fits on screen; a full-page shot includes below-the-fold content. Confirm that the chosen tool supports full-page capture.
- Viewport dimensions and scale: set the dimensions for the intended layout. A mobile viewport can trigger responsive styles; a larger viewport may change navigation or column layout. Device scale affects pixel dimensions and file size.
- Readiness: wait for the content that matters. A page-load event does not guarantee that client-side rendering, lazy-loaded images, or animations have settled. Conversely, waiting for all network activity may hang on sites with ongoing requests.
- Output format: PNG is useful when preserving sharp text or transparency matters; JPEG can be suitable for photographic output where lossy compression is acceptable. Confirm format support and quality controls with the selected API.
- Region: capture a specific element or clipped rectangle when a whole-page image is unnecessary. Element capture can avoid unrelated page content, but the target must exist and be visible.
- Response handling: treat image bytes as binary, not text. If a service returns a URL instead, handle its expiry and access rules as documented by that provider.
Reliability, performance, and cost
Self-hosted browser rendering shifts operational responsibility to your application. Browser startup, page navigation, resource loading, and screenshot encoding all contribute to request duration. Reusing browser processes may reduce repeated startup work, but requires careful isolation and cleanup so one request’s page state does not leak into another. Close pages or contexts and handle browser crashes and navigation timeouts explicitly.
Outdated 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 matchPC 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 & 11Rank #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
A hosted endpoint removes the need to operate browser processes, but adds a network dependency and whatever limits, pricing, and retention terms the provider sets. Before choosing, review the vendor’s current docs and terms for request quotas, timeout behavior, retry guidance, data processing, and image delivery. The available provider documentation cited above does not establish a common benchmark or comparable price basis, so benchmark your own page types and request volumes if those determine the decision.
For either method, avoid unbounded concurrency: each render consumes browser or service capacity, and full-page images can be substantially larger than viewport captures. Use explicit timeouts, cap retries, and log the input URL or job identifier, completion status, and response type. Do not retry a deterministic error such as invalid HTML input or rejected authentication as though it were a transient network failure.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshooting common screenshot problems
- Image is blank or missing expected text: the page may have been captured before client rendering completed. Wait for a selector or application-ready state, then capture.
- Fonts or images are absent: check that asset URLs are accessible from the rendering environment and that the page has had time to load them. Relative URLs need a valid base URL.
- Screenshot is cut off: the capture may cover only the viewport. Enable full-page capture or use the relevant element or clip option.
- Layout differs from the browser you expected: set viewport dimensions and device scale explicitly, and account for responsive breakpoints. Compare like-for-like conditions.
- Navigation times out: the site may keep network requests open or be slow to respond. Use an appropriate readiness condition, set a bounded timeout, and wait for the specific content rather than every network request.
- Hosted call returns an error instead of an image: inspect the HTTP status and response headers before treating the body as image data. Confirm the method, authentication, required parameters, and provider-specific HTML input format.
- Image is unexpectedly large: reduce viewport dimensions, capture an element instead of a full page, or choose a suitable supported format and quality setting.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. Its one-request endpoint returns an image or PDF, with PNG, JPEG, or WebP output options. This cURL example saves a screenshot of a URL:
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 authentication and request options. You can also call the endpoint from Python:
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.
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)
Or from 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}`);
ScreenshotNeo removes cookie and consent banners, newsletter popups, and chat widgets before capture; those cleanup steps can be turned off. Bot checks or 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 lets AI agents use screenshot tools. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots.
Sign up for ScreenshotNeo’s free plan to try the endpoint with 1,000 screenshots a month and no card.
Frequently Asked Questions
Does an HTML screenshot API capture the source code or the rendered page?
It captures browser-rendered output: the browser processes the markup, styles, scripts, and assets before producing the image.
Can I capture HTML that is not hosted at a public URL?
Yes, with a browser workflow such as Playwright, load the HTML string into a page and make any referenced assets reachable to that browser. Hosted API support for raw HTML varies by provider.
Is a screenshot API always faster or cheaper than Playwright?
Not necessarily. The sources cited here do not establish a comparable speed or cost result; workload, infrastructure, and provider pricing determine the trade-off.
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.

