Skip to content
@html2img

html2img

Providing free HTML to image APIs, including screenshot APIs, opengraph image generation APIs and templates, and lots more: https://html2img.com
HTML to Image API

Convert HTML, CSS or any URL into a PNG with a single API call.

Website · Docs · Templates · Tools · Pricing · Compare

Free tier, 25 renders a month Getting started docs Sign up, no card required


HTML to Image is a REST API that turns raw HTML and CSS, a live URL, or a named JSON template into a PNG in seconds. Every render runs in real Chrome, so flexbox, grid, custom properties, web fonts and inline JavaScript behave exactly as they do in the browser. The first 25 renders each month are free, with no card required.

This organisation hosts the official client libraries for the API. The PHP SDK and Laravel integration are available now on Packagist. Watch or star the repos to get notified when more ship.

Quick start

Send some HTML, get back a hosted PNG.

curl -X POST https://app.html2img.com/api/html \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"html": "<h1>Hello world</h1>"}'
{
  "success": true,
  "credits_remaining": 95,
  "id": "abc123",
  "url": "https://i.html2img.com/abc123.png"
}

Grab a key from your dashboard, then read the getting started guide and the authentication docs.

Three ways to render

Endpoint Use it for Docs
POST /api/html Your own markup and CSS, full design control html parameter
POST /api/screenshot Capturing a public URL you already host url parameter
POST /api/v1/templates/[slug] A tested design, JSON in, PNG out browse templates

The base URL for every endpoint is https://app.html2img.com. Full parameter reference is in the docs.

What you can build

There are 25 named templates in total, covering social, commerce, content and marketing.

Official packages

Install the official libraries from Packagist. Anything else works over plain HTTP today.

Language Install Repo Status
PHP composer require html2img/html2img-php html2img-php Available
Laravel composer require html2img/html2img-laravel html2img-laravel Available
JavaScript and Node.js npm In development
Python, Ruby and more Planned

PHP

Framework-agnostic, built on Guzzle, returns a typed response object. Requires PHP 8.3+.

use Html2img\Html2imgClient;
use Html2img\Request\HtmlRequest;

$client = new Html2imgClient('your-api-key');

$response = $client->html(new HtmlRequest(
    html: '<!doctype html><html><body><h1>Hello</h1></body></html>',
    width: 1200,
    height: 630,
));

echo $response->url; // https://i.html2img.com/abc123def456.png

See the PHP SDK readme and the PHP guide.

Laravel

Zero-config auto-discovery, a Html2img facade, a published config file, one-line saving to any filesystem disk, and an html2img:test artisan health check. Requires Laravel 11 or 12.

use Html2img\Laravel\Facades\Html2img;
use Html2img\Request\HtmlRequest;

$response = Html2img::html(new HtmlRequest(
    html: view('og.post', ['post' => $post])->render(),
    width: 1200,
    height: 630,
    dpi: 2,
));

$path = Html2img::store($response, "og/{$post->id}.png");

See the Laravel integration readme and the Laravel guide.

Free browser tools

No sign-up needed. Build an image in the browser, then move to the API when you want to automate it.

See the full image generation tools hub.

Language guides

Worked examples for the seven languages developers reach for most. Anything that can make an HTTP request will work.

PHP · Laravel · Ruby on Rails · Python · JavaScript and Node.js · React · Vue

Built for production

  • Real Chrome rendering so your output matches the browser. Features
  • Webhook delivery for renders that run past the 30 second sync window. webhook_url docs
  • DPI control from 1x to 4x for retina output when you need it. dpi docs
  • Custom fonts from Google Fonts, Adobe Fonts and self-hosted @font-face, all server-side.
  • Global CDN, with images served from i.html2img.com.

How it compares

Honest, side-by-side notes against the common alternatives, covering pricing, features and migration effort.

Guides and articles

Pricing

Start free with 25 renders a month and no card. Paid plans raise the render volume as you grow. See pricing.

Links

Website · Features · Templates · Tools · Docs · Compare · Articles · Pricing · About · Contact


Built by the team behind HTML to Image.

Create a free account · Login

© 2026 HTML to Image

Popular repositories Loading

  1. statamic-og-images statamic-og-images Public

    Automatically generate OG images for any post type. No server configuration necessary, works everywhere. Powered by html2img.com

    PHP 1

  2. .github .github Public

  3. html2img-php html2img-php Public

    Framework-agnostic PHP SDK for https://html2img.com service (HTML to Image API/Screenshot API)

    PHP

  4. html2img-laravel html2img-laravel Public

    Laravel integration for https://html2img.com service (HTML to Image API/Screenshot API)

    PHP

Repositories

Showing 4 of 4 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…