Recommended Free Tools
To convert HTML into an image or PDF, render it in a browser and capture the result. With Playwright, use page.screenshot() for PNG, JPEG, or WebP and page.pdf() for PDF. A hosted API is another option: send HTML in an HTTP request and receive the rendered output. The right path depends on whether you want to operate the browser yourself, which rendering controls you need, and where your HTML may be processed.
Choose a conversion approach
HTML is a description of a page, not a finished image or document. Conversion therefore requires a renderer that lays out the HTML and CSS, loads applicable fonts and images, and then captures the rendered page.
| Approach | What you do | Useful when |
|---|---|---|
| Playwright in your environment | Run browser automation, load or render the HTML, then call a screenshot or PDF method. | You need direct control over the browser and want the resulting bytes in your application. |
| Hosted conversion API | Send HTML and rendering options over HTTP; the provider operates the rendering process. | You prefer an HTTP integration to running browser processes yourself. |
The documentation cited here describes available features, but does not establish a measured comparison of speed, image quality, reliability, or cost. Evaluate those factors for your own workload rather than assuming one approach is faster or more reliable.
Convert HTML to PNG or PDF with Playwright
Playwright separates image capture from PDF generation. The examples below use its JavaScript API and Node.js with an HTML string. Install Playwright and its browser binaries in your project according to the Playwright installation guide. These examples write the output to local files.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#1 Best Overall
- Convert your PDF files into Word, Excel & Co. the easy way
- Convert scanned documents thanks to our new 2022 OCR technology
- Adjustable conversion settings
- No subscription! Lifetime license!
- Compatible with Windows 11, 10, 8.1, 7 - Internet connection required
Render HTML and save a PNG
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
try {
const page = await browser.newPage({ viewport: { width: 1200, height: 800 } });
const html = `<!doctype html>
<html>
<head><meta charset="utf-8"><title>Example</title></head>
<body><h1>Hello from HTML</h1><p>Rendered in a browser.</p></body>
</html>`;
await page.setContent(html, { waitUntil: 'load' });
await page.screenshot({ path: 'output.png', fullPage: true, type: 'png' });
} finally {
await browser.close();
}
})();
The screenshot API returns image data; specifying path saves it directly. PNG is the default format. The documented alternatives are JPEG and WebP. Set fullPage: true to capture the full page rather than only the current viewport. See the Playwright Page API and its screenshots guide for current options.
Render HTML and save a PDF
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch();
try {
const page = await browser.newPage();
const html = `<!doctype html>
<html>
<head><meta charset="utf-8"><title>Example</title></head>
<body><h1>Hello from HTML</h1><p>Saved as PDF.</p></body>
</html>`;
await page.setContent(html, { waitUntil: 'load' });
await page.pdf({ path: 'output.pdf', format: 'A4', printBackground: true });
} finally {
await browser.close();
}
})();
page.pdf() returns PDF data and can save it with path. PDF generation uses print CSS media by default. If the PDF should use screen media styles instead, select them before generating the PDF:
await page.emulateMedia({ media: 'screen' });
await page.pdf({ path: 'output.pdf', format: 'A4', printBackground: true });
Page dimensions and other print-related settings affect the result; consult the Playwright Page API for the current PDF options.
Rank #2
- Transform audio playing via your speakers and headphones
- Improve sound quality by adjusting it with effects
- Take control over the sound playing through audio hardware
Render an existing page instead of an HTML string
If your HTML is available at a URL, navigate to it rather than calling setContent():
await page.goto('https://example.com', { waitUntil: 'load' });
await page.screenshot({ path: 'page.png', fullPage: true });
Use a URL your application is permitted to access. A page that relies on scripts, remote assets, or delayed content may need a more specific readiness condition; a navigation event does not necessarily mean every image or application update has finished.
Control what the renderer captures
Viewport, page length, and pixel density
The viewport sets the browser’s visible layout area and can change responsive CSS. A viewport screenshot captures that visible area; a full-page screenshot extends the capture to the page’s full height. Screenshot scale can be set to CSS pixels or device pixels, which changes output pixel dimensions. Choose a viewport and scale that match the intended display or downstream processing.
Rank #3
- The Data Recovery Stick requires no technical skills — simply plug it into your Windows computer, click Start, and the software automatically begins scanning and recovering lost files within minutes. Compatible with Windows Vista, 7, 8, 10, & 11, it's designed to be a reliable first step when accidental deletion occurs.
- Recover photos (JPG, BMP, PNG, TIFF), Microsoft Office documents (Word, Excel, PowerPoint, Publisher, Access), Open Office files, MP3 music files, PDFs, RTF documents, AutoCAD files, and HTML web pages. Whether it's personal memories or critical business files, the Data Recovery Stick covers the file types that matter most.
- Works with hard drives, USB drives, SD cards, memory sticks, and other common storage formats that use FAT or NTFS file systems — making it a single solution for hard drive recovery, USB drive recovery, SD card recovery, and more. Note: a media reader is required for micro SD cards and some mass storage devices.
- No Installation Required - The Data Recovery Stick runs entirely from the USB drive with no software installation on your computer — helping prevent new data from overwriting the files you're trying to recover. This also makes it ideal for use across multiple computers or in emergency situations where installation isn't practical.
- Use the Data Recovery Stick on as many computers as often as needed — simply clear the recovered data between uses to free up storage space. Software updates keep the tool compatible with newer systems and devices, backed by 25+ years of data software expertise from Paraben Consumer Software.
Image format and transparency
Playwright supports PNG, JPEG, and WebP screenshots, with PNG as the default. Its screenshot options include transparent backgrounds. Transparency may be useful for compositing, but page backgrounds and CSS affect what is rendered; check the API documentation for the applicable option and behavior.
Print versus screen appearance in PDFs
PDF generation applies print CSS media by default. Websites may use print styles to hide navigation, alter colors, or rearrange content. Use page.emulateMedia({ media: 'screen' }) before page.pdf() when the screen stylesheet is the intended appearance. PDF page dimensions and print-related settings also determine pagination and background treatment.
Dynamic content and external assets
For HTML with scripts, images, or fonts, wait until the content needed in the output is ready. The examples wait for the page’s load event, but that may not cover content loaded later by application code. For a controlled page, wait for a meaningful selector or other application-specific readiness signal before capture. For HTML with remote assets, confirm the browser can reach those resources in the environment where Playwright runs.
Rank #4
- Export or Convert Text, HTML, PNG, JPG, or Camera Pictures to PDFs
- Unlimited use
- No ads
- No personal data taken
- GDPR compliant
Use a hosted HTML conversion API
A hosted API moves browser operation behind an HTTP request. The html2png.dev API reference documents POST https://html2png.dev/api/convert, with raw HTML in the request body and PNG, JPEG, WebP, or PDF as output formats. Its reference lists a default viewport of 1200 by 630, a deviceScaleFactor range of 1–4, and settings for delay, selector, zoom, and transparent background. These are provider-documented details, not independently tested behavior; confirm current request syntax and output handling in the provider’s reference before integrating it.
Before sending production content to a hosted renderer, check its current limits, privacy and data-handling terms, supported input and output behavior, and how it returns the result. The cited API reference does not establish pricing, operational limits, privacy terms, latency, or reliability.
Or skip the browser setup
ScreenshotNeo is a website screenshot API that can return PNG, JPEG, WebP, or PDF. For HTML-to-image conversion, its documented HTML/CSS-to-image option lets you submit HTML without running a browser process in your application. See the ScreenshotNeo documentation for request parameters and output options.
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 & 11Crashes, 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 minuteBest Value
- Mix an audio, music and voice tracks
- Record single or multiple tracks simultaneously
- Intuitive tools to split, trim, join, and many other editing features
- Loaded with audio effects including EQ, compression, reverb, and more.
- Load an audio file and export to all popular audio formats from studio quality wav to high compression formats
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
This example captures a URL. For HTML/CSS input, use the HTML-to-image option documented by ScreenshotNeo. ScreenshotNeo also removes cookie banners, newsletter popups, and chat widgets before capture; these cleanup steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. An MCP server provides screenshot tools for AI agents, and 1,000 screenshots per month are free with no card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month without a card.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Choose settings and integration based on the output
- For an image of a page: use a screenshot method, decide between viewport and full-page capture, and select PNG, JPEG, or WebP based on the output’s needs.
- For a document: use PDF generation and decide whether print or screen CSS should apply; set page dimensions and print options accordingly.
- For controlled deployment: local Playwright keeps browser automation in your environment, while a hosted API avoids operating browser processes yourself. Consider whether a third party may process the HTML and result.
- For dependable rendering: make asset availability and dynamic-content readiness explicit, and test representative pages with the viewport, scale, and media mode you intend to use.
- For output delivery: Playwright provides data buffers that your application can save or return. For a hosted provider, verify whether the response is bytes or a hosted URL and handle it accordingly.
Troubleshoot common conversion problems
The output is blank or missing content
- Confirm the HTML was loaded with the expected encoding and that the page has content before capture.
- For URL-based pages, check that the browser can access the destination and its assets.
- If content appears after load, wait for an application-specific selector or readiness condition rather than capturing immediately.
Images, fonts, or styles are missing
- Check that linked assets use URLs reachable from the browser environment.
- For local assets, ensure the browser process can access the paths or serve the files to the page.
- Wait for required assets to load before capturing; a page load event may not cover assets introduced later by scripts.
The PDF does not look like the browser page
- Check whether print CSS is changing the layout; PDF generation uses print media by default.
- Use screen media before PDF generation if screen styling is what you need.
- Review page size, margins, and print-background options in the current Playwright API documentation.
The image is clipped or has unexpected dimensions
- Check the viewport dimensions and whether you intended a viewport or full-page screenshot.
- Check the screenshot scale: CSS-pixel and device-pixel output produce different pixel dimensions.
- For a hosted API, confirm its viewport and device-scale settings; the documented html2png.dev defaults and ranges are provider-specific.
Frequently asked questions
Can an API convert HTML that is not hosted on a public website?
Yes, when the integration accepts HTML as input. Playwright can render an HTML string with page.setContent(), and the html2png.dev reference documents raw HTML in a POST request body. For any hosted provider, check its current input requirements and data-handling terms before sending private content.
Does a PNG capture include the entire page?
Not by default in Playwright: a screenshot captures the viewport unless you request a full-page capture with fullPage: true.
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 minuteWhich should I use: PNG or PDF?
Use PNG when you need a raster image of the rendered page. Use PDF when you need a paginated document; its appearance may follow print CSS rather than the screen layout.
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.

