Node.js  ·  HTML to Image

HTML to Image
in Node.js — no Puppeteer

Native fetch, zero extra dependencies, 0 MB added to your bundle. Works on Express, Fastify, Vercel, and AWS Lambda.

Start Free — 100 renders/mo View API Docs
Code Example

Works in any Node.js environment

ESM or CommonJS, Express or serverless functions — same API call either way.

ESM / fetch
Express endpoint
AWS Lambda
render.js
Node.js 18+
// render.js — works anywhere Node 18+ fetch is available
export async function htmlToImage(html, { width = 1200, height = 630 } = {}) {
  const res = await fetch('https://api.renderpix.dev/v1/render', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${process.env.RENDERPIX_API_KEY}`,
    },
    body: JSON.stringify({ html, width, height, format: 'png' }),
  })

  if (!res.ok) throw new Error(`RenderPix error: ${res.status}`)

  const { url } = await res.json()
  const img = await fetch(url)
  return Buffer.from(await img.arrayBuffer())
}
Use Cases

What Node.js developers use it for

📷
OG image endpoints
Route handler that generates a unique social card for every blog post, product page, or user profile — on demand or pre-generated at build time.
📄
Invoice & receipt images
Render an HTML invoice template to a print-ready PNG. Email it as an attachment, store on S3, or serve as a downloadable image — no PDF library required.
🏅
Certificates & badges
Generate personalised certificates for course completions, achievements, or events. Inject the recipient's name and render a pixel-perfect PNG in milliseconds.
Comparison

Your Node.js HTML-to-image options

Approach Vercel / Lambda Bundle overhead Full CSS Setup time
RenderPix API Yes 0 MB Yes < 5 min
Puppeteer No ~300 MB Yes 2–4 hrs
@vercel/og (Satori) Yes < 5 MB Subset only 1–2 hrs
node-html-to-image No ~300 MB Yes 1–2 hrs
FAQ

Common questions

Does Node.js 18 fetch work, or do I need node-fetch?

Node.js 18+ includes native fetch — no node-fetch needed. If you're on Node 16 or below, add node-fetch or upgrade. The code examples above use native fetch throughout.

Does it work on Vercel serverless functions?

Yes. Your function makes a standard outbound HTTPS request — no binary layer, well under the 250 MB size limit. Works on Vercel Hobby and Pro. Use it in api/ routes or App Router route handlers.

How do I handle custom fonts?

Include a <link> tag for Google Fonts or a @font-face block in your HTML string. The renderer waits for fonts to load before capturing, so your typography renders exactly as in a browser.

Can I generate WebP instead of PNG?

Yes — set "format": "webp" in the request body. WebP output is typically 30–50% smaller than PNG for the same visual quality, which makes a difference if you're serving OG images from a CDN.

What's the rate limit?

Free tier: 100 renders/month. Paid plans start at $9/month for 2,000 renders with no rate limiting per second — you can fire concurrent requests. Check the pricing page for details.

HTML to image in Node.js — in minutes

No binary dependencies, no cold starts. Free tier, no credit card required.