To convert HTML to a JPG, render the HTML in a browser and save a screenshot as JPEG. For local files and fine-grained control, Playwright’s Page screenshot API supports JPEG quality, viewport or full-page capture, and CSS-pixel or device-pixel output. For a managed capture workflow, CloudConvert documents JPG output from a URL or HTML file. Choose the method based on where your HTML lives and how much control you need over rendering.
What “HTML to JPG” actually means
HTML is a document format, not an image format. A browser lays out the HTML along with its CSS, fonts, and other resources, then captures the rendered result as pixels and encodes those pixels as a JPEG image. A conversion can therefore look different from the source if fonts or images have not loaded, scripts have not run, or the viewport differs from the one the page was designed for.
First decide whether you are converting a local HTML document or capturing a page served at a URL. Then choose the capture scope: the visible viewport, a particular element, or the whole page. Finally set output dimensions and, where available, JPEG quality. Those choices affect both what appears in the image and its sharpness and file size.
Convert HTML to JPG locally with Playwright
Playwright’s official Page API documentation lists jpeg as a screenshot type and documents options including a file path, JPEG quality, full-page capture, and scale. The example below uses Node.js and saves a viewport screenshot from a local HTML file. Install Playwright and its browser before running it.
Free tools Windows power users keep installed
One-click scans. No signup required.
#1 Best Overall
- 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
- Install: In a project directory, run
npm install playwright, thennpx playwright install chromium. - Save the HTML: Put the document at
./page.html. Relative asset paths in that file need to resolve from its location. - Save this script as
convert.js:const { chromium } = require('playwright'); const path = require('path'); (async () => { const browser = await chromium.launch(); try { const page = await browser.newPage({ viewport: { width: 1280, height: 900 }, deviceScaleFactor: 1 }); await page.goto('file://' + path.resolve('./page.html'), { waitUntil: 'load' }); await page.screenshot({ path: 'page.jpg', type: 'jpeg', quality: 85, fullPage: false, scale: 'css' }); } finally { await browser.close(); } })(); - Run: Execute
node convert.js. The output ispage.jpgin the project directory.
The example deliberately uses a viewport screenshot: the output covers 1280 × 900 CSS pixels. For a page taller than that, set fullPage: true to capture the full scrollable page. To base output resolution on device pixels rather than CSS pixels, use scale: 'device'; the output pixel dimensions will then reflect the device scale factor. For example, a device scale factor of 2 produces more pixels per CSS pixel and a larger image.
Set quality and capture scope intentionally
Playwright’s JPEG quality option accepts a value from 0 to 100; higher values preserve more image detail and generally produce larger files. Quality is a lossy-compression setting, not a resolution setting. Change viewport dimensions or scale to change pixel dimensions. The fullPage option captures the whole page rather than only the current viewport; use it when content below the fold matters.
If you need only a component rather than the page, Playwright also supports capturing a target element through its locator screenshot API. That is useful for exporting a chart, card, or preview without surrounding navigation. Confirm the current option names and behavior in the Page API documentation before building around less common settings.
Rank #2
- 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
Use a hosted website-capture API
A hosted service can render a URL or HTML input without requiring you to manage a browser process in your own application. CloudConvert’s Website Screenshot API says it accepts a URL or HTML file and produces JPG or PNG screenshots using a Chrome-based pipeline. Its capture-website operation documentation describes creating a capture job with a URL and output format. CloudConvert also documents full-height capture by default, along with viewport, zoom, resizing, selector waits, synchronous or asynchronous jobs, and storage integrations.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →CloudConvert’s product page states a starting price of $0.008 per file. That is the vendor’s displayed price claim, not an independent price comparison; check the current service pricing and job requirements before relying on it.
When using a hosted API, verify which form of HTML input it accepts, how it handles local assets, what waits are available for dynamic content, and how the result is delivered. The documented CloudConvert operation is a job flow, so account setup, job creation, completion, and output retrieval may be part of integration rather than one simple local function call.
Rank #3
- 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.
Choose local rendering or a managed service
| Need | Local Playwright | Managed capture |
|---|---|---|
| HTML source | Works with a local HTML file or navigated URL; you control the browser code. | CloudConvert documents URL or HTML-file input. |
| Output scope | Viewport or full-page; element capture is available through locator screenshots. | CloudConvert describes full-height capture by default and viewport controls. |
| Image controls | JPEG quality and CSS-pixel or device-pixel scale are documented by Playwright. | CloudConvert describes viewport, zoom, and resizing controls. |
| Operational ownership | You install and operate the browser runtime in your environment. | The vendor operates the capture pipeline; the integration uses its job/API workflow. |
This is an architectural comparison, not a claim that one approach is faster, safer, more accurate, or cheaper overall. The cited documentation does not provide an independent comparative benchmark.
Or skip the browser setup: ScreenshotNeo
ScreenshotNeo is a website screenshot API and MCP server from Yorker Media. For a live URL, one GET request returns an image or PDF. It removes known cookie-consent banners, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →For a quick JPG capture of a live page, request JPEG output as documented in the ScreenshotNeo API documentation. Keep your access key private; do not put it into browser-side code or a public page.
curl -G "https://api.screenshotneo.com/v1/shot"
-d access_key=YOUR_API_KEY
--data-urlencode url=https://stripe.com
-d format=jpg
-o shot.jpg
ScreenshotNeo has a free plan with 1,000 shots per month and no card required; paid plans start at $5 for 3,000 shots. Every feature is on every plan. Sign up for the free plan to get 1,000 screenshots a month with no card.
Rank #4
- 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
Other implementation options
Python request example for ScreenshotNeo
If your application already uses Python, this request saves the returned image bytes to a file. The endpoint and parameters are documented in the ScreenshotNeo API documentation.
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={
"access_key": "YOUR_API_KEY",
"url": "https://stripe.com",
"format": "jpg",
},
timeout=90,
)
r.raise_for_status()
with open("shot.jpg", "wb") as image:
image.write(r.content)
Node.js request example for ScreenshotNeo
This uses the same one-call endpoint from Node.js; it writes the response body to a file.
const fs = require('fs/promises');
const q = new URLSearchParams({
access_key: 'YOUR_API_KEY',
url: 'https://stripe.com',
format: 'jpg'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
await fs.writeFile('shot.jpg', Buffer.from(await res.arrayBuffer()));
These hosted examples capture a URL, not arbitrary local HTML. For a local file that is not publicly reachable, use a local browser workflow such as Playwright or consult the service documentation for supported input options.
Best Value
- 【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.
Troubleshoot common conversion problems
- The image is cut off: You likely captured only the viewport. In Playwright, use
fullPage: truefor the entire scrollable document, or increase the viewport height when only a taller visible region is wanted. - Images, fonts, or charts are missing: The capture may have happened before resources or client-side rendering finished. Wait for the relevant selector or page state before taking the screenshot. For local HTML, check that relative paths resolve and that the browser can access each asset.
- The output looks blurry: Check the CSS dimensions and scale. A larger JPEG quality value affects compression, while device-pixel scale affects pixel density; quality alone cannot add resolution.
- The JPG has an unexpected background: JPEG does not support transparency. If transparency matters, use a format that supports it, such as PNG, where available.
- The hosted capture does not match a local render: Compare viewport size, zoom, loaded assets, and timing. A hosted browser and a local browser can differ in environment; the cited sources do not establish pixel-identical results across environments.
- Playwright cannot launch its browser: Ensure you installed the browser binary with
npx playwright install chromiumand that the host environment permits the browser to run. The exact system dependencies vary by environment. - The API call fails or returns an error: Check the URL, access key, output format parameter, network access, and service response. For ScreenshotNeo, review the response headers and API documentation; for CloudConvert, follow the documented job creation and completion flow.
Performance, reliability, and cost considerations
A local browser gives you direct control over when capture happens and how the browser is configured, but you must deploy and maintain the browser runtime. A hosted service shifts browser operation to the provider, while making your workflow dependent on its API, job handling, and pricing. The cited materials do not provide independent measurements for throughput, latency, availability, security, or total cost, so evaluate those against your own workload rather than assuming one architecture wins.
For repeated captures, avoid rendering the same page more often than needed, choose only the required capture scope, and consider whether asynchronous jobs or caching fit the workflow. For public websites, verify that you are authorized to capture the content and that your use follows applicable site terms and privacy obligations. Do not send secrets in a URL that may be logged.
Frequently Asked Questions
Does converting HTML to JPG preserve links and selectable text?
No. The output is a raster image of the rendered page; links and text are no longer interactive or selectable.
Can I convert a private page that requires login?
A local Playwright session can be configured for authenticated access. For a hosted service, verify its supported authentication inputs and your security requirements before sending credentials.
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.




