DummyImage API
Free placeholder image API with no key: any size, custom background and text colours, custom caption, PNG, GIF or JPG — all from the URL. Tested example included.
Endpoint tested and returned HTTP 200 on 2026-08-21
What is the DummyImage API?
DummyImage is a free, key-free placeholder image generator. The entire request is encoded in the URL — dimensions, background colour, foreground colour, file format and caption text — and the response is the generated image, so it works directly in an `img` tag.
Placeholder images are one of those needs that recur in every project: a design mockup before the photography exists, a fallback when a user has no avatar, a fixture in a test suite. DummyImage covers it with a URL grammar you can memorise in one reading — width by height, then optional background and foreground colours, then an optional extension.
It is worth choosing it over the better-known placeholder.com specifically because it has stayed up and stayed free while several competitors either went dark or moved behind a sign-up. The service does everything server-side and adds no tracking, and because the URL fully determines the output, generated images cache perfectly at every layer.
Quick facts
- Base URL
https://dummyimage.com- Authentication
- No API key, no account and no attribution requirement. Generated images are plain shapes and text, so there is no third-party content licensing to worry about.
- Rate limit
- No published limit. Responses are highly cacheable, so a CDN in front removes almost all repeat traffic.
- Pricing
- Free.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the DummyImage API
Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.
1. Generate a 200x100 black placeholder with white text
GET https://dummyimage.com/200x100/000/fff.png
curl 'https://dummyimage.com/200x100/000/fff.png'const res = await fetch("https://dummyimage.com/200x100/000/fff.png");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);import requests
res = requests.get("https://dummyimage.com/200x100/000/fff.png", timeout=20)
res.raise_for_status()
print(res.json())# This endpoint returns image/png, not JSON.
# The response body is the image itself, so it can be used directly as an
# <img src="..."> or saved to a file — there is nothing to parse.
#
# Verified: HTTP 200, Content-Type: image/pngParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
size | path segment | Required | Dimensions as `WIDTHxHEIGHT`, or a single number for a square. This is the only required part. 200x100 |
background | path segment | Optional | Background colour as a hex value without the leading hash. Three-character shorthand works. 000 |
foreground | path segment | Optional | Text colour, also hex without the hash. Only meaningful alongside a background. fff |
format | extension | Optional | File extension appended to the last path segment: `.png`, `.gif` or `.jpg`. Defaults to PNG. png |
text | query | Optional | Caption to render. Defaults to the image dimensions. ByteTools |
(ratio) | path segment | Optional | A ratio such as `16:9` can be used in place of pixel dimensions. 16:9 |
Response fields
(body)image- The generated image as raw bytes — PNG by default, or GIF/JPG when requested via the file extension.
Content-Typeheader- `image/png`, `image/gif` or `image/jpeg`, matching the extension you asked for.
(caption)rendered- When no `text` parameter is given, the image is captioned with its own dimensions, which is what makes it useful in a layout review.
What you can build with the DummyImage API
- Fill a design mockup or wireframe with correctly sized placeholders
- Provide a default avatar or cover image when a user has uploaded none
- Generate deterministic image fixtures for front-end tests
- Show layout dimensions visually while debugging a responsive grid
Common errors and how to fix them
400
Malformed size segment.
Fix: Dimensions must be `WIDTHxHEIGHT` using a literal `x`, or a ratio like `16:9`. A comma or a space fails.
Colour ignored
The hex value included a `#`.
Fix: Colours are bare hex in the path — `000`, not `#000`. A `#` in a URL starts the fragment, so everything after it never reaches the server.
Text not showing
The caption is longer than the image is wide.
Fix: Shorten the text or increase the width; DummyImage does not wrap or shrink to fit.
DummyImage API — frequently asked questions
Is the DummyImage API free?
Yes, completely free with no API key, no account and no attribution requirement. Because it renders plain shapes and text rather than photographs, there is no content licensing to consider either.
How do I set custom colours on a DummyImage placeholder?
Put them in the path as bare hex values: `/200x100/000/fff` gives white text on black. Do not include the `#` — a hash in a URL begins the fragment, so the server never sees anything after it.
Can I put custom text on the placeholder?
Yes, with the `text` query parameter. Leave it off and the image is captioned with its own dimensions, which is genuinely useful when you are reviewing a responsive layout.
What image formats does DummyImage support?
PNG by default, plus GIF and JPG by appending `.gif` or `.jpg` to the last path segment. PNG is the right default for flat colour and text.
Tools that pair with this API
Image Size Checker
Check image dimensions, file size, aspect ratio and megapixels online for one or many images at once. Fast, free and fully private in your browser.
Image to Base64 Converter
Convert an image to a Base64 data URL online. Get copy-ready HTML img tags and CSS background-image snippets. Free, instant and fully private.
PNG to SVG Converter
Convert PNG to SVG online by tracing raster pixels into scalable vector shapes. Free browser-based vectorizer for logos, icons and pixel art.
DummyImage is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.