HTML to Image

Convert HTML & CSS to PNG, JPEG, or WebP — free, no signup

API Usage

Send HTML as a POST body. Get an image back.

curl

curl -X POST \
  -d '<h1 style="color:red">Hello World</h1>' \
  "https://51-68-119-197.sslip.io/api/html2image?format=png" \
  > output.png

OG Image (1200x630)

curl -X POST \
  -d '<div style="background:#1a1a2e;padding:40px;text-align:center">
    <h1 style="color:white;font-size:48px">My Article</h1>
  </div>' \
  "https://51-68-119-197.sslip.io/api/html2image?format=webp&width=1200&height=630" \
  > og-image.webp

Python

import urllib.request
html = '<h1 style="color:blue">Generated Image</h1>'
req = urllib.request.Request(
    "https://51-68-119-197.sslip.io/api/html2image?format=png",
    data=html.encode(), method="POST"
)
req.add_header("Content-Type", "text/html")
with urllib.request.urlopen(req) as resp:
    with open("output.png", "wb") as f:
        f.write(resp.read())

JavaScript (Node.js)

const html = '<h1 style="color:green">Dynamic Image</h1>';
const resp = await fetch('https://51-68-119-197.sslip.io/api/html2image?format=webp', {
  method: 'POST',
  body: html,
  headers: { 'Content-Type': 'text/html' }
});
const buffer = await resp.arrayBuffer();
require('fs').writeFileSync('output.webp', Buffer.from(buffer));

Use Cases

OG Images / Social Cards — Generate Open Graph images dynamically for blog posts, product pages, or user profiles. Standard 1200x630 dimensions.
Certificates & Badges — Create personalized certificates, achievement badges, or completion diplomas from HTML templates.
Email Previews — Preview HTML email templates as images before sending. Test rendering across different widths.
Invoice Generation — Render HTML invoices as images for email attachments or PDF conversion.
Chart & Report Images — Convert HTML/SVG charts to shareable image formats for reports and dashboards.

Parameters

widthViewport width, default 800, max 1920
heightViewport height, default 600, max 1080
formatpng (default), jpeg, webp
scale1 (default), 2, or 3 for retina
dark_modetrue/false — emulate dark color scheme
quality1-100 for JPEG/WebP

Need Higher Volume?

Direct access is rate-limited. For production use:

Get a Free API Key — 50 requests/day, instant:

RapidAPI PRO/ULTRA — up to 60 req/min, from $9.99/mo:

All APIs on RapidAPI →

Also: Screenshot API | Dead Link Checker | SEO Audit | Full pricing