🎨

Placeholder Image Generator

Generate placeholder images with custom dimensions, text, and colours

POST 1 credit /v1/image/placeholder
curl -X POST "https://image.toolkitapi.io/v1/image/placeholder" \
  -H "Content-Type: application/json" \
  -d '{"width": 800, "height": 600, "text": "Hero Image", "bg_color": "#3498db", "text_color": "#ffffff"}'
import httpx

resp = httpx.post(
    "https://image.toolkitapi.io/v1/image/placeholder",
    json={"width": 800, "height": 600, "text": "Hero Image", "bg_color": "#3498db", "text_color": "#ffffff"},
)
print(resp.json())
const resp = await fetch("https://image.toolkitapi.io/v1/image/placeholder", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
  },
  body: JSON.stringify({"width": 800, "height": 600, "text": "Hero Image", "bg_color": "#3498db", "text_color": "#ffffff"}),
});
const data = await resp.json();
console.log(data);
# See curl example
Response 200 OK
{
  "image": "iVBORw0KGgoAAAANSUhEUg...(base64 data)...",
  "format": "png",
  "size": {"width": 800, "height": 600},
  "label": "Hero Image"
}

Try It Live

Live Demo

Description

Generate placeholder images with custom dimensions, text, and colours

How to Use

1

1. Set `width` and `height` for the desired image dimensions (1–4000 pixels each).

2

2. Optionally provide custom `text` — defaults to "WxH" (e.g. "800x600") if omitted.

3

3. Set `bg_color` and `text_color` as hex codes to match your design system.

4

4. Choose the output `format`: png, jpeg, or webp.

About This Tool

Use the Placeholder Image Generator to create dummy images for UI mockups, wireframes, and development environments. Specify exact dimensions, custom label text, background colour, and text colour.

The GET variant returns raw image bytes, so you can use it directly as an `` URL in HTML — no server-side code required. The POST variant returns base64 JSON for programmatic use.

Images scale their text size automatically based on dimensions, ensuring the label is always readable regardless of image size.

Why Use This Tool

Frequently Asked Questions

Can I use the GET endpoint directly in HTML?
Yes. Use `<img src="https://image.toolkitapi.io/v1/image/placeholder?width=400&height=300">` to embed a placeholder image directly. The GET endpoint returns raw image bytes with the correct Content-Type header.
What is the maximum image size?
Both width and height can be up to 4000 pixels. This allows generating placeholders up to 4000×4000 for high-resolution mockups.
How is the text sized?
The font size is automatically calculated as 1/8 of the smaller dimension (width or height), with a minimum of 14 pixels. This ensures readability at any size.

Start using Placeholder Image Generator now

Get your free API key and make your first request in under a minute.