Menu
Sign up

HTML to image API: what it is, and which one to use

An HTML to image API renders your HTML and CSS in a browser and returns a PNG. How they work, the two models, and 9 APIs compared on price.

Published November 8, 2026 · 5 min read

An HTML to image API takes HTML and CSS (or a web page's URL), lays it out in a real browser on the vendor's servers and sends back an image — PNG, JPEG or WebP, often PDF too. You get pixel-exact pictures from markup without running Chrome yourself. Which one to use depends on whether you send new HTML each time or reuse one layout; of the 9 APIs compared below, SnapRender costs least per image on its cheapest plan, at $4.50 per 1,000.

We make Shareglint, one of the APIs in the table, so the comparison links every vendor's own pricing page, read on 2026-11-08, and says where others are better.

How an HTML to image API works

The service runs a pool of headless browsers. A request carries either the HTML and CSS, the name of a stored template plus the values that change, or a URL. The browser loads it at the size you ask for — 1200×630 for an Open Graph image, 1080×1080 for a square post — waits for fonts and images, and captures the viewport or the whole page. The answer is the file itself or a URL to it on the vendor's storage, ready for an og:image tag, an email or a download.

Because it is a browser, everything your browser understands works: CSS grid and flexbox, web fonts, gradients, shadows, emoji, right-to-left text. That is the difference from libraries that re-implement a subset of CSS. Next.js's ImageResponse, for example, supports "only flexbox and a subset of CSS properties", a 500 KB bundle and ttf, otf and woff fonts (Next.js docs).

Two models: HTML in every request, or a stored template

  • HTML in every request. You build the whole document on your side and POST it. Best when each image is different anyway: a chart, a receipt, a code snippet. HTMLCSStoImage ("POST https://hcti.io/v1/image" with html) and html2img work this way, and so do screenshot APIs that accept HTML as well as URLs.
  • A stored template. You save the HTML and CSS once, with named fields, and each image is a small request with only the values that change. Best for the same branded layout filled thousands of times: OG images, social cards, certificates. RenderForm and Shareglint work this way; with us you POST /v1/templates once, then POST /v1/images with the template's slug and its fields.

Most teams that start with HTML in every request move to templates once the same card is rendered for every page of a site: the request stops carrying kilobytes of markup, the design is versioned in one place, and a repeat with the same fields is free from cache.

The APIs, compared on price

Tool (pricing page) Cheapest plan $ per 1,000 on it 10,000 a month Free tier Renders your HTML/CSS MCP server
SnapRender $9 for 2,000 $4.50 $29 200 a month Yes Yes
Shareglint $9 for 2,000 $4.50 $29 100 a month, watermarked Yes Yes
ScreenshotOne $17 for 2,000 $8.50 $79 100 a month Yes Yes
html2img $9 for 1,000 $9 $60 50 once, not monthly Yes Yes
ScreenshotAPI.net $9 for 1,000 $9 $29 7-day trial Yes Yes
Urlbox $49 for 5,000 $9.80 $99 Trial only Yes Yes
HTMLCSStoImage $14 for 1,000 $14 $69 50 a month Yes Yes
APITemplate.io $35 for 1,500 $23.33 $179 50 a month Yes Not stated
RenderForm $9 for 250 $36 $169 50 once, not monthly Yes Yes

How to read it: $ per 1,000 on it is the cheapest paid plan's price divided by its images; 10,000 a month is the cheapest public way to get 10,000, by the same rule our pricing page uses. Monthly billing, before tax. "Not stated" means we did not find it on the vendor's site. Screenshot APIs (ScreenshotOne, Urlbox, SnapRender, ScreenshotAPI.net) count one capture of your HTML like one of a URL.

Where each one is the better choice

  • HTMLCSStoImage is a dedicated HTML-to-image service with an Image Debugger that re-runs any image in a fresh browser. Choose it for raw HTML per request with good tooling.
  • html2img is a cheap raw-HTML endpoint with 25 named templates; its free renders are a one-off.
  • SnapRender and ScreenshotOne are screenshot APIs that also render your HTML; choose them when you need screenshots of other sites as well. SnapRender's 200 free captures a month carry no watermark that we found.
  • Urlbox is built for hard sites, with proxies and anti-blocking on its higher plans; it has no free plan.
  • APITemplate.io is document-first: its HTML-to-PDF endpoint also writes PNG or JPEG, and it has PDF-only plans.
  • RenderForm stores HTML templates and rolls unused credits over.
  • Shareglint stores HTML templates or builds them in a visual editor, ships 153 built-in designs, renders every template in 6 sizes from one request, signs og:image URLs that render on first view, and takes website screenshots on the same quota. Where we are weaker: our Free plan's 100 images a month carry a watermark, and we take HTML as a stored template, not raw in every render request.

Doing it yourself instead

You can run the same browser yourself: Puppeteer's page.screenshot() or Playwright's equivalent, on a server with Chrome installed. It is free in licence fees and costs you in operations — Chrome's memory per page, fonts installed on the server, timeouts on slow images, a queue so a traffic spike does not start fifty browsers, and security if the HTML comes from users. For a few images a day on a server you already run, that is fine. For images rendered on demand, by crawlers you do not control, a hosted API is usually cheaper than the time spent on it. Our guides for JavaScript and Python show both routes in code.

Try it

The HTML to image playground renders your own HTML and CSS to a PNG with no account, so you can check fonts and layout before choosing any API. For Next.js specifically, Next.js OG images without @vercel/og limits has a complete opengraph-image.tsx that calls an API.

FAQ

What is an HTML to image API?

A web service that takes HTML and CSS (or a URL), lays it out in a real browser on its own servers and returns an image — usually PNG, JPEG or WebP, often PDF too — so you get pictures from markup without running Chrome yourself.

Which HTML to image API is cheapest?

Of the 9 in our table, SnapRender has the lowest price per 1,000 on its cheapest plan: $9 for 2,000 ($4.50 per 1,000). Prices from each vendor's pricing page, read on 2026-11-08; we make Shareglint.

Should I send HTML in every request or store a template?

Send HTML in every request when each image is a different document you generate anyway. Store a template when the layout stays the same and only the text and images change: the request is smaller, the design lives in one place, and identical fields can be served from cache.

Can I do it without an API?

Yes: run Puppeteer or Playwright with headless Chrome yourself, or use Satori (@vercel/og) for simple flexbox layouts. You then maintain the browser, fonts, memory and timeouts; an API is the same Chrome, run for you.