Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →To convert an HTML file or webpage to JPG, render it in a browser and save a JPEG screenshot. To convert many HTML pages into separate JPG images, loop over the inputs, capture each page with Playwright, and give every output a deterministic filename. This approach renders CSS, web fonts, JavaScript, and responsive layouts; converting HTML as text alone does not.
The examples below use Playwright with JavaScript and Chromium. They cover local files and URLs, full-page captures, JPEG quality, repeatable batch naming, common failures, and post-processing.
What you need to convert HTML to JPG
HTML describes a page; a browser turns that description into pixels. Use a browser renderer when the result must reflect CSS layout, web fonts, JavaScript-generated content, or responsive behavior. Playwright can capture the rendered page as JPEG, and its screenshot API includes controls for full-page capture, quality, clipping, and scale.
The batch conversion is not one multi-page JPG file. It produces a separate image for each input. Decide whether each image should show just the visible viewport or the entire scrollable document, and keep the viewport and readiness conditions consistent if you need repeatable output.
Free tools Windows power users keep installed
One-click scans. No signup required.
#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.
Install Playwright and prepare your inputs
For a local JavaScript project, install Playwright and its Chromium browser:
npm init -y
npm install playwright
npx playwright install chromium
Save the script below as convert.mjs. Use a list of local HTML file paths or page URLs. The script creates an output directory and names images in input order, such as output-001.jpg. Keep the mapping between input and output clear if you will need to retry individual pages.
Batch-convert HTML pages to separate JPG images
This runnable example accepts local file paths and URLs. It uses a single Chromium browser and processes pages sequentially, which is simple to operate and avoids launching a browser for every input. Replace the sample entries with your own.
import { chromium } from 'playwright';
import { mkdir } from 'node:fs/promises';
import { pathToFileURL } from 'node:url';
const inputs = [
'./pages/first.html',
'./pages/second.html',
'https://example.com/'
];
const outputDir = './jpg-output';
const width = 1440;
const height = 900;
const quality = 85;
await mkdir(outputDir, { recursive: true });
const browser = await chromium.launch();
try {
const page = await browser.newPage({ viewport: { width, height } });
for (const [index, input] of inputs.entries()) {
const target = input.startsWith('http://') || input.startsWith('https://')
? input
: pathToFileURL(input).href;
const filename = `output-${String(index + 1).padStart(3, '0')}.jpg`;
await page.goto(target, { waitUntil: 'networkidle' });
await page.screenshot({
path: `${outputDir}/${filename}`,
type: 'jpeg',
quality,
fullPage: true
});
console.log(`${input} -> ${outputDir}/${filename}`);
}
} finally {
await browser.close();
}
Run it with node convert.mjs. The fullPage: true option captures the full scrollable page. Set it to false if you want only the viewport-sized image. JPEG quality is explicit in the example; adjust the value to trade image size against compression artifacts. Playwright’s API documents the JPEG quality setting and other screenshot controls.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Using only local HTML files
The sample converts relative paths into file:// URLs. If an HTML file loads stylesheets, scripts, or images by relative paths, keep those assets in the expected locations relative to the HTML file. For pages that depend on server behavior or routes, serve them locally and pass their HTTP URLs instead.
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.
Choosing a readiness condition
The example waits for networkidle, but it is not a universal definition of “ready.” Analytics, ads, streaming connections, and other long-lived requests can prevent the page from becoming idle; conversely, a page may become idle before a late image or font appears. For a known application, prefer a page-specific signal, such as a selector that appears after rendering:
await page.goto(target, { waitUntil: 'domcontentloaded' });
await page.locator('#report-ready').waitFor();
Use the signal that actually means your content is ready. If fonts affect layout, wait for the page’s font loading to settle before capture; if images load lazily while scrolling, use full-page capture and verify that the page’s lazy-loading behavior has completed. Playwright documents that full-page captures cover the scrollable page, but page-specific content loading still needs an appropriate readiness strategy.
Control the screenshot dimensions and content
Viewport versus full page
A normal screenshot captures the current viewport. With fullPage: true, Playwright captures the complete scrollable document instead. Full-page output can be much taller than the viewport and may produce large files or expose content that would otherwise require scrolling. Use viewport captures for fixed-size previews and full-page captures for a complete page record.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
JPEG quality and visual trade-offs
JPEG is a lossy format. The sample’s quality value of 85 is a chosen setting, not a benchmark or guarantee of a particular file size. If text edges or fine details show compression artifacts, raise quality or consider whether PNG is more appropriate for the workflow. If file size matters more than fine detail, lower quality and inspect representative outputs before processing a large batch.
Clip a region or control scaling
When you need a specific region rather than the full viewport or page, Playwright’s screenshot API supports clipping. It also exposes scale and background-related controls. These options are useful for making consistent crops, but their values must match the target page and desired output dimensions; a clip rectangle that falls outside page content will not capture the intended area. Consult the Playwright screenshot guide and Page API screenshot options for the current option details.
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.
Use the Playwright command line instead
For a quick one-off capture, Playwright’s CLI supports JPEG output, full-page mode, and a custom output filename. The command pattern is:
npx playwright screenshot --device="Desktop Chrome" --type=jpeg --full-page --output=page.jpg https://example.com
Use the CLI for individual pages or shell-driven workflows. For a batch with deterministic names, per-page error handling, custom readiness logic, and logging, use the JavaScript loop above. Check the installed CLI’s help if its available flags differ by Playwright version.
Convert many pages reliably
Keep batch results traceable
Use a stable input order and zero-padded filenames so sorting preserves that order. For large runs, keep a manifest mapping each source to its output rather than relying only on the numeric suffix. If a page fails, record that input and retry it without renumbering successful outputs.
Choose sequential or parallel processing
The example reuses one page sequentially. This is a straightforward starting point and limits the number of simultaneous pages and their resource use. Parallel pages can increase throughput, but also consume more memory and CPU and can change timing or stress remote sites. No neutral speed benchmark is established for Playwright versus Puppeteer; choose based on operational constraints and test your own pages.
Make captures as repeatable as the content allows
- Use a fixed viewport and consistent browser environment.
- Wait for a meaningful readiness signal instead of assuming every site is settled at the same event.
- Control fonts, external resources, animations, and other changing content when visual consistency matters.
- Record failures individually so one unavailable page does not erase the progress of the batch.
Even with these controls, third-party resources and dynamic page content can change between runs. Do not describe the output as pixel-perfect unless you control the relevant rendering inputs.
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
Post-process the JPG files with ImageMagick
Let the browser perform HTML rendering, then use ImageMagick for image operations such as resizing, compression, or renaming a sequence. Its sequence formatting supports numbered names such as image-%d.jpg. Keep this stage separate from capture so a rendering problem can be distinguished from an image-processing problem. Check the ImageMagick documentation for the commands and options applicable to your installation.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC 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 & 11Playwright or Puppeteer?
Both Playwright and Puppeteer provide a browser-based Page.screenshot() workflow with JPEG and full-page options. The cited documentation establishes these capabilities; it does not provide a neutral benchmark proving one is faster or visually more faithful. Choose based on your runtime, browser requirements, existing project, and the controls you need.
| Decision point | Playwright | Puppeteer |
|---|---|---|
| Screenshot workflow | Documented Page screenshot API and CLI | Documented Page.screenshot() workflow |
| JPEG and full-page options | JPEG type, quality, clipping, scale, and full-page behavior are documented | Type, quality, path, and fullPage options are documented |
| Language/runtime and browser fit | Choose according to your application’s runtime and browser needs; documentation should guide the supported configuration. | Choose according to your application’s runtime and browser needs; documentation should guide the supported configuration. |
| Comparative speed or visual fidelity | Not established by the cited documentation | Not established by the cited documentation |
For a new JavaScript batch script, the Playwright example above supplies a complete path from input list to named JPEG files. If your project already uses Puppeteer, its documented screenshot API may be the simpler fit; the same overall pattern applies: navigate, wait for page-specific readiness, capture each input, and close the browser.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshooting HTML-to-JPG conversion
The image is blank or missing content
The page may have been captured before its JavaScript finished rendering, or the local file may not be loading its linked assets. Wait for a meaningful selector or application-ready signal, verify that stylesheets and images resolve from the file’s location, and confirm the page is visible in a normal browser under the same URL.
The script hangs at network idle
A persistent request can keep the network active. Replace networkidle with a suitable navigation event and wait for a page-specific selector or readiness signal. Avoid arbitrary delays unless you have established that the content needs them; a fixed delay may still be too short on a slow run and unnecessarily long on a fast one.
Recommended Free Tools
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.
The screenshot is cut off
If you intended a full document capture, check that fullPage: true is set. If using a clip, verify its coordinates and dimensions. For pages that expand content only as the user scrolls, ensure lazy-loaded sections have been triggered before relying on a full-page result.
The layout differs from the browser preview
Check the viewport, fonts, device scale, animations, and resources loaded from external services. A different viewport can trigger responsive breakpoints, and an unavailable web font can change line wrapping. Make those inputs consistent where possible and wait for the correct font and content state.
A JPG is unexpectedly large or blurry
Full-page dimensions and image content affect size; JPEG quality controls compression, not page dimensions. Reduce dimensions after capture if that suits the use case, or adjust quality and compare text and image details. Use ImageMagick as a post-processing stage rather than expecting it to fix a browser rendering issue.
One item fails in a batch
Log the source and error for each capture and preserve successful outputs. Check whether the URL is reachable, whether the local path is correct, and whether the page’s readiness condition ever becomes true. Retry only the failed input after correcting its cause.
Or skip the browser setup
If you need a hosted screenshot rather than maintaining a local browser script, ScreenshotNeo accepts a URL and returns a PNG, JPEG, WebP, or PDF. For a one-page JPEG request, use:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.jpg
See the ScreenshotNeo API documentation for request parameters and output controls. Cookie/consent banners, newsletter popups, and chat widgets are removed before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. The free plan and paid-plan features are available from the ScreenshotNeo sign-up page.
Frequently Asked Questions
Can I save several HTML pages as one JPG?
No. JPG is a single-image format; a batch normally creates one separate JPG per HTML input. Use a PDF if you need multiple pages in one document.
Can I convert HTML to JPG without a browser?
Only if you do not need browser-rendered layout and behavior. For CSS, fonts, JavaScript, or responsive rendering, use a browser engine such as Chromium through Playwright.
Does full-page capture include content that loads only after scrolling?
A full-page screenshot captures the scrollable document, but it does not guarantee that every site’s lazy-loaded content has already appeared. Trigger or wait for that content before capture.
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.

