HTML to Image
- You start with
- HTML code or .html file
- You get
- PNG, JPG or WebP
You wrote the markup yourself and it is not hosted anywhere. Paste it here and get a pixel image. This is the page you are on.
Use this converterTo convert HTML to image, paste your HTML and CSS below or upload an .html file, pick PNG, JPG or WebP, set a width, and click Convert. ScreenshotAPI.net renders the code in a real Chromium browser so fonts, flexbox and scripts look exactly as they do on screen, then gives you the image to download for free with no signup.
Free to use. No account required.
You do not need to host the page anywhere. The converter takes the raw code, renders it once, and hands back a PNG, JPG or WebP in a few seconds.
Each step maps to one API parameter, shown on the right, so the same settings work when you automate it later.
Drop the markup into the editor, or upload an .html file from your computer. Inline styles, a style block, web fonts and scripts are all allowed.
custom_htmlChoose PNG, JPG or WebP, set the width and height in pixels, and switch on retina for a 2x image or transparent for a PNG with no background.
file_type · width · height · retinaClick Convert. ScreenshotAPI.net renders the HTML in a real Chromium browser and shows the finished image, ready to download or open in a new tab.
output=imagePNG is the default for a reason. When you convert HTML to PNG the output is lossless, and it is the only format here that can carry an alpha channel. That makes it the right choice when the image has to sit on top of something else.
Convert HTML to JPG when the file has to be small and a solid background is fine. The quality slider decides how hard the image is compressed. At 90 the text edges stay clean. Drop towards 20 and blocks appear around letters and sharp edges, in exchange for a much smaller file.
Most free HTML to image tools run html2canvas inside your browser tab. That library reads the styles and redraws the page onto a canvas, which is why the result is an approximation. This tool loads your HTML and CSS in a headless Chromium on ScreenshotAPI.net servers and takes a real screenshot of it.
Canvas redraw tools
This converter
One thing to remember: pasted HTML has no domain behind it. Relative paths such as images/logo.png point nowhere, so use full https:// URLs or data URIs for images and stylesheets.
An HTML to image generator is only useful if you control the size of what comes out. Five settings cover almost every job, and each one is a single API parameter under the hood.
width · heightThe viewport the HTML is laid out in, in CSS pixels. Use 1200 × 630 for an Open Graph image, 600 wide for email, or any size up to 4000.
full_page=trueIgnore the height and capture everything from the top of the document to the bottom. Handy for receipts and long tables.
retina=trueRenders at double pixel density, so a 1200 wide layout comes back as a 2400 pixel image that stays sharp on high DPI screens and in print.
image_qualityA value from 0 to 100 for JPG output. PNG and WebP ignore it.
omit_background=trueRemoves a plain page background from the PNG output so the element can be placed on any surface.
Anything you can style with HTML and CSS can become an image. These are the jobs people run through the converter most.
Render a 1200 × 630 card from an HTML template for every blog post or product, with the title and author pulled in from your CMS.
Email clients ignore most CSS. Build the header in HTML, convert it to a 600 pixel wide JPG, and drop the image into the template instead.
Turn a styled HTML receipt into a PNG your customers can attach to an expense report, using auto height so nothing is cut off.
Design one certificate in HTML, swap in each name, and export a transparent PNG badge that sits cleanly on a dark profile page.
Let a JavaScript chart library draw the graph, then capture it as an image for a Slack report or a PDF appendix.
Convert HTML code blocks, pull quotes or testimonials into sharp images for social posts without a screenshot tool.
Generating thousands of social cards or receipts? Send the same HTML in a POST request to the ScreenshotAPI.net API and get the PNG back in one call, with no Puppeteer or Chromium to run yourself.
custom_htmlfile_typewidth / heightretina / omit_backgroundAll three run on the same ScreenshotAPI.net rendering engine. The difference is what you start with and what you need back.
Need the whole scroll of a live page as one image? Try the full page screenshot tool. Want a PDF from a URL instead? Use the URL to PDF generator.
Common questions about converting HTML to PNG, JPG and WebP, transparent backgrounds, and automating it with the ScreenshotAPI.net API.
Don't see your question here?
Browse all help articles