Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To convert HTML to JPG, render the HTML in a browser and capture the rendered page as a JPEG. For a one-time image, use a browser’s screenshot capability. For repeatable output, automate a real browser with Puppeteer or Playwright, set the viewport, wait for dynamic content, and save a screenshot with JPEG quality configured. The same method works for a live URL and a local HTML file.

What “HTML to JPG” actually means

HTML is markup, not an image format. A browser must first resolve CSS, fonts, images, scripts, and layout. The conversion is therefore a rendering step followed by screenshot capture and JPEG encoding. The result shows what the page looked like at capture time, not the original HTML source.

  • Live page: navigate to an HTTPS URL and capture its rendered state.
  • Local document: open an HTML file (or provide its contents) in a browser page, then capture it.
  • Selected content: capture a CSS-selected element or a clipped rectangle instead of the whole page.

JPEG is opaque and lossy. It cannot preserve transparency, and output dimensions and file size depend on viewport, page content, device scale, and quality settings.

Choose a conversion method

Situation Best approach Trade-off
One image, no automation Browser screenshot or developer tools Fast, but menu names vary by browser and operating system.
Repeated captures or a build pipeline Puppeteer or Playwright Requires Node.js and a browser runtime, but gives predictable options.
Server-side capture without managing a browser ScreenshotNeo API Network request and API key required; rendering is handled for you.

Do not print the page to PDF merely to turn it into JPG unless a PDF is required for another reason. A PDF intermediate adds a conversion stage and can use print media styles rather than the screen appearance.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Liene M100 4x6'' Photo Printer, Phone Printer 100 Sheets & 3 Cartridges, Full-Color Photo, Portable Instant Photo Printer for iPhone Android, Thermal Dye Sublimation, Wi-Fi Picture Printer 100 Papers
  • User-Friendly Portable Photo Printer for iPhone, Android & PC - Get beautiful and colourful memories with Liene 4x6 photo printer! After opening the entire package, you can find one cartridge + 20 sheets of photo paper (placed inside the machine packaging), as well as an additional box containing 80 sheets of photo paper (which includes two cartridges + 80 sheets of photo paper). Full package includes smartphone photo printer, Liene 4x6 photo printer papers (100 sheets), 3 colour cartridges, and fully sealed cassette to prevent dust. Minimalist and magnetic design for compact storage.
  • Superior Quality 4x6 Photo Printer - Print photos like no other thanks to the thermal-dye sublimation tech adopted by the picture printer for iphone. The dyes deeply penetrate the paper for vibrant photo printing, and the laminated surface is resistant to water, scratches, fingerprints and fading. Clean the print head promptly if smudges are observed on printed photos during operation. Get Liene photo printers now for yourself and your loved ones, print your happy moments together and keep your love forever!
  • Wi-Fi Photo Printer for Smartphone - The built-in hotspot of the photo printer makes it easy to print pictures from your phone, avoiding outside interference with a fast and stable connection. No other networks required! Simply connect your device to the independent instant photo printer 4x6 hotspot.
  • Multiple Device Compatibility - Liene phone printer provides instant photo printing for up to 5 simultaneous connections. Share with family and friends or print from your different devices. No additional cables or Bluetooth required when printing photos with this picture printer. Note: Ensure the ink cartridge clicks into place before printing.
  • Customize your Printing with the Liene App - Customize your photos with our specialized App! You can add a Square border, insert filters, enhance the contrast and brightness, check printing status, and more. You can even print your ID and Visa photos from home with this photo printer for iphone 4x6 prints.

Convert HTML to JPG with Puppeteer

Puppeteer’s page.screenshot() method captures a rendered page and supports JPEG output and a quality value. The official references are Puppeteer’s page workflow and screenshot options.

Install Puppeteer

  1. Install a current Node.js release.
  2. Create a project directory and run npm init -y.
  3. Install Puppeteer with npm install puppeteer. The package normally downloads a compatible browser during installation.

Capture a live URL as a full-page JPG

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  try {
    const page = await browser.newPage();
    await page.setViewport({ width: 1200, height: 800, deviceScaleFactor: 1 });
    await page.goto('https://example.com', { waitUntil: 'networkidle2', timeout: 90000 });
    await page.screenshot({
      path: 'page.jpg',
      type: 'jpeg',
      quality: 85,
      fullPage: true
    });
  } finally {
    await browser.close();
  }
})();

Run it with node capture.js. The explicit type: 'jpeg' makes the format unambiguous; Puppeteer can also infer the format from a .jpg or .jpeg path. If you omit the type, screenshot output defaults to PNG.

Capture a local HTML file

Use an absolute file URL so relative CSS, images, and scripts resolve from the document’s directory:

const path = require('path');
const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  try {
    const page = await browser.newPage();
    await page.setViewport({ width: 1200, height: 900 });
    const fileUrl = 'file://' + path.resolve('invoice.html');
    await page.goto(fileUrl, { waitUntil: 'networkidle0', timeout: 90000 });
    await page.screenshot({ path: 'invoice.jpg', type: 'jpeg', quality: 90, fullPage: true });
  } finally {
    await browser.close();
  }
})();

For pages that fetch remote resources, confirm that the local file’s security policy, credentials, and network access permit those requests. An alternative is to serve the directory with a local HTTP server and navigate to its URL.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Wait for content that appears after navigation

Network-idle signals do not guarantee that a chart, web font, or client-rendered component is ready. Wait for a meaningful selector or an application-specific condition:

Rank #2
KODAK Dock Plus 4x6 Photo Printer, Smartphone Docking, 4PASS, 50 Sheets
  • Dock Photo Printer: The KODAK Dock Plus is a home photo printer that produces high-quality 4x6” prints directly from compatible smartphones. Featuring an integrated docking station, users can place their phone on the printer for better connection while simultaneously charging the device during printing.
  • Genuine 4PASS dye sublimation printing: Each photo is produced in three color layers and finished with a clear protective lamination layer. In approximately 55 seconds, you receive a smooth, detailed print designed to resist fingerprints, water, and fading for long-lasting quality.
  • Easy to Use: Print photos quickly without complicated setup or technical steps. Simply power on, connect wireless bluetooth, and start printing within seconds. The Dock Plus is built for straightforward operation, making it ideal for first time users and everyday photo printing.
  • Home Printing Station: Designed for stable desktop use, this dock photo printer connects to a power outlet for consistent performance and larger 4x6” prints. Ideal for home printing, photo albums, framing, family events, and everyday picture printing.
  • KODAK Photo Printer APP: Featuring integrated Bluetooth connectivity, this portable printer connects to compatible iOS and Android devices through the KODAK Photo Printer app. Edit, crop, and customize your photos before printing for creative results.
await page.goto('https://example.com/dashboard', { waitUntil: 'domcontentloaded' });
await page.waitForSelector('#report-ready', { timeout: 30000 });
await page.screenshot({ path: 'dashboard.jpg', type: 'jpeg', quality: 85, fullPage: true });

A fixed delay such as await new Promise(r => setTimeout(r, 2000)) can help with a known animation, but a selector or readiness condition is usually more reliable.

Capture an element or a clipped region

const card = await page.$('.pricing-card');
await card.screenshot({ path: 'card.jpg', type: 'jpeg', quality: 88 });

await page.screenshot({
  path: 'hero.jpg',
  type: 'jpeg',
  quality: 88,
  clip: { x: 0, y: 0, width: 1200, height: 500 }
});

Element capture follows the element’s rendered bounds. A clip uses CSS-pixel coordinates relative to the page viewport, so verify the resulting dimensions when device scale or responsive breakpoints matter.

Playwright alternative

Playwright provides the same browser-rendering workflow and lists jpeg as a screenshot type, with optional quality and path settings in its Page screenshot API.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch();
  try {
    const page = await browser.newPage({ viewport: { width: 1200, height: 800 } });
    await page.goto('https://example.com', { waitUntil: 'networkidle', timeout: 90000 });
    await page.screenshot({ path: 'page.jpg', type: 'jpeg', quality: 85, fullPage: true });
  } finally {
    await browser.close();
  }
})();

Playwright documents omitBackground as not applicable to JPEG. In practice, select PNG when a transparent background is a requirement; JPEG always needs an opaque background.

Control dimensions, quality, and appearance

Viewport versus full document

A normal screenshot is limited to the viewport. Set width and height before navigation so responsive CSS chooses the intended layout. fullPage: true (Puppeteer or Playwright) expands the capture to the document’s full scrollable height; a long page therefore produces a very tall JPG. Use an element screenshot or clip for a bounded region.

Rank #3
Sale
Nelko PP01 Photo Printer, 2x3 Portable Photo Printer, Mini Printer, White
  • 2x3" Portable Photo Printer: The upgraded PP01 photo printer uses advanced inkjet technology. This portable photo printer produces vivid, full-color prints on premium sticky-backed photo paper that is smudge-proof, water-resistant, and tear-resistant. The Nelko mini photo printer is pocket-sized and weighs only 308g, making it ultra-portable for school, travel, and field trips. Each ink cartridge prints up to 80 full-color 2x3 photos on sticky-backed paper
  • Easy Printing via Bluetooth: The PP01 mini photo printer is compatible with iOS and Android phones via Bluetooth. Simply download the Nelko app from Google Play or the App Store. Load the 2x3 photo paper with the smooth side facing down. Install the ink cartridge, connect via Bluetooth, and print directly using the Nelko app. A USB charging cable is included; the adapter is not included
  • High Photo Quality: This mini photo printer uses advanced inkjet technology for clear, vibrant prints. This portable photo printer produces 600 DPI high-resolution images with precise colors, capturing fine details and realistic tones. Each photo comes with adhesive backing, perfect for scrapbooks and preserving your memories. Personalize every photo for holidays, birthdays, or daily events
  • Powerful App: The Nelko 2x3" PP01 photo printer app lets you edit photos and offers a variety of frame designs, making it perfect for personalizing your photos for projects like scrapbooking or journaling. Download the Nelko app to create collages and customize photos with filters, graffiti, borders, stickers, text, AI image editing, and many other features. Edit photos on your phone, then send them to the Nelko app for instant printing in under 90 seconds
  • Versatile Usage Scenarios: This portable photo printer is ideal for travel journals, party favors, and family gatherings. Students use it for planners and photo printing. Crafters use it for DIY projects, custom labels, and scrapbooking. It's a practical tool for bloggers, small businesses, and event photographers to create instant giveaways. Perfect for Mother's Day surprises and heartfelt moments with loved ones using Nelko sticky-backed photo paper.

Pixel dimensions and device scale

Viewport dimensions are CSS pixels. A device scale factor can produce more physical pixels than the CSS width and height. Inspect the saved file rather than assuming a requested viewport equals the final JPG dimensions, especially when retina settings or a cloud browser is involved.

JPEG quality and file size

Set an integer quality value supported by your library. Higher quality generally retains more detail and creates a larger file, but there is no universal file-size result: photographs, text-heavy pages, gradients, compression settings, and dimensions all change the outcome. Compare representative output and choose the lowest quality that preserves readable text and important detail.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Fonts, images, and dynamic layout

  • Wait for a specific content selector and, when necessary, for fonts or images to finish loading.
  • Use a stable viewport and timezone when screenshots are compared in tests.
  • Expect ads, rotating banners, clocks, personalization, and A/B tests to vary between runs.
  • Browser version, operating system fonts, and remote assets can change rendering; do not assume pixel identity across environments without testing.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. Send one GET request with a URL and receive a PNG, JPEG, WebP, or PDF. It is the first option to try when you want a managed capture service: cookie and consent banners, newsletter popups, and chat widgets are removed before the shot; bot checks, blank pages, timeouts, failed loads, and cache hits are not billed; and each response identifies the page and billing result with X-Page-Verdict and X-Billed headers.

The API supports full-page capture with lazy images, CSS-selector element capture, dark mode, device presets or custom viewports, retina scale, JPEG quality, custom CSS and JavaScript, click actions, hide selectors, waits for selectors/delays/network idle, request and resource blocking, headers, cookies, user agents, authorization, timezone, geolocation, resizing, configurable-TTL caching, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification. An MCP server exposes take_screenshot, get_page_info, and capture_pdf to Claude, Cursor, and other MCP clients.

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)
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}`);

See the ScreenshotNeo documentation for format, viewport, waiting, authentication, and delivery parameters. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots, and every feature is available on every plan. Create a free ScreenshotNeo account to begin.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting HTML-to-JPG conversions

The image is blank or only partly rendered

Cause: capture occurred before client-side rendering or a required resource completed. Fix: wait for a page-specific selector, increase the navigation timeout, and verify that scripts, fonts, and images can load in the capture environment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Liene Amber M110 Bluetooth Photo Printer 80 Sheets, Portable Photo Printer for iPhone, Thermal Dye Sublimation, Picture Printer 60 Sheets 4x6 Paper & 20 Sheets 3" Square Sticker Paper & 2 Cartridges
  • Dual 4x6" & 3x3" Photo Printer Paper Tray Convenience: Seamlessly print both 6-inch standard photo paper and 3-inch sticky-backed paper with our innovative dual tray design. This compact phone photo printer for smartphone offers easy storage and quick access, making it perfect for diverse printing needs without taking up much space. Enjoy vibrant, high-quality prints every time.
  • Fast Bluetooth Connectivity: Experience lightning-fast printing with our liene photo printer's Bluetooth connection, which pairs in just 13 seconds. Enjoy a seamless and efficient printing experience, perfect for capturing and sharing memories on the go without the hassle of cables or complex setups.
  • Superior Quality Photo Printer 4x6 - Print photos like no other thanks to the thermal-dye sublimation tech adopted by the picture printer for iphone. The dyes deeply penetrate the paper for vibrant photo printing, and the laminated surface is resistant to water, scratches, fingerprints and fading. Get Liene photo printers now as amazing gifts for yourself and your loved ones, print your happy moments together and keep your love forever!
  • Multiple Device Compatibility - Liene picture printer for iphone provides instant photo printing for up to mutiple simultaneous connections. Share with family and friends or print from your different devices. No additional cables required when printing photos with this phone printer.
  • Customize your Printing with the Liene App - Customize your photos with our specialized App! You can add a Polaroid border, insert filters, enhance the contrast and brightness, check printing status, and more. You can even print your ID and Visa photos from home with this iphone photo printer for 4x6 & 3x3 prints.

The JPG shows a mobile layout

Cause: the default viewport is narrower than expected. Fix: call setViewport (Puppeteer) or create a Playwright context with the required width and height before navigation.

The page is cut off

Cause: a viewport screenshot captures only what is visible. Fix: use fullPage: true, capture the target element, or provide a clip rectangle. Check whether the page uses an internal scrolling container rather than document scrolling.

Images or fonts are missing

Cause: relative paths, blocked cross-origin requests, authentication, or network timing. Fix: use the correct absolute file URL or local server, provide required cookies or headers, wait for the assets, and inspect browser console/network errors.

JPEG transparency is missing

Cause: JPEG has no alpha channel. Fix: set an opaque background or choose PNG for transparent output.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Automation fails to launch

Cause: the browser executable is absent or the runtime lacks required system dependencies. Fix: reinstall the package’s browser, install the dependencies recommended for your operating system, or configure an approved executable path. Keep the browser and automation-library versions compatible.

Best Value
KODAK Mini 2 Retro 2x3 Portable Photo Printer, 4PASS, 38 Sheets, White
  • Instant Photo Printing: The KODAK Mini 2 Retro is a portable photo printer designed to turn smartphone pictures into high quality prints in seconds. Whether capturing family moments, travel highlights, journaling pages, or creative projects, this mini printer lets you print real photos anytime, anywhere.
  • Genuine 4PASS dye sublimation printing: Each photo is produced in three color layers and finished with a clear protective lamination layer. In approximately 55 seconds, you receive a smooth, detailed print designed to resist fingerprints, water, and fading for long-lasting quality.
  • Easy to Use: Print photos quickly without complicated setup or technical steps. Simply power on, connect wireless bluetooth, and start printing within seconds. The Mini 2 Retro is built for straightforward operation, making it ideal for first time users and everyday photo printing.
  • Print Anytime, Anywhere: Small enough to fit in your hand, bag, or even a pocket, the Mini 2 Retro is built for on-the-go printing. Ideal for parties, trips, school projects, scrapbooks, and spontaneous moments where you want real prints without waiting.
  • KODAK Photo Printer APP: Featuring integrated Bluetooth connectivity, this portable printer connects to compatible iOS and Android devices through the KODAK Photo Printer app. Edit, crop, and customize your photos before printing for creative results.

Repeated captures differ

Cause: animations, time-dependent content, random data, ads, personalization, or browser differences. Fix: freeze test data where possible, disable animations with custom CSS, set a deterministic viewport and timezone, wait for readiness, and compare only after inspecting the actual image.

Reliability, security, and cost considerations

  • Reliability: use explicit readiness checks, bounded timeouts, retries for transient navigation failures, and cleanup in a finally block so browsers close even when capture fails.
  • Security: treat URLs and HTML as untrusted input. Restrict which destinations a service may visit, protect API keys, and avoid exposing private cookies or authorization headers in logs.
  • Performance: reuse a browser process for batches, keep pages isolated, block unnecessary resources when fidelity permits, and use caching only when a fresh render is not required.
  • Cost: local Puppeteer and Playwright consume your own compute. A managed API charges according to its plan and capture rules; ScreenshotNeo bills only clean shots and identifies the result in response headers.
  • Validation: open the saved JPG and check dimensions, cropping, text legibility, background color, and dynamic sections before distributing it.

Quick decision checklist

  1. Is this a one-off image? Use a browser screenshot.
  2. Do you need repeatable output or CI integration? Use Puppeteer or Playwright.
  3. Choose the viewport before loading the page.
  4. Decide between viewport, full page, element, or clip capture.
  5. Wait for the content that must appear, not just navigation completion.
  6. Set JPEG quality and verify the actual file size and dimensions.
  7. Use PNG instead if transparency is required.
  8. For managed capture, call ScreenshotNeo and inspect its verdict and billing headers.

FAQ

Can I convert an HTML string without saving an HTML file?

Yes. Create a browser page, call page.setContent(yourHtml), wait for its resources or a readiness selector, and take a JPEG screenshot. External assets still need reachable URLs and appropriate permissions.

Should I use JPG or JPEG?

They refer to the same image format. Use whichever extension your pipeline expects; explicitly setting the screenshot type avoids relying on filename inference.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why does my screenshot include a cookie banner?

A browser automation script captures whatever is visible unless you dismiss or hide the banner. A managed service such as ScreenshotNeo can accept consent banners before capture and remove known consent platforms.

Can a JPG contain selectable HTML text?

No. A JPG is a raster image. Keep the original HTML or generate a PDF when selectable text and document structure are required.

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.