Placehold.co API
Free placeholder image API with no key: generate images at any size with custom colours, text and format straight from a URL. No JSON needed. Tested example.
Endpoint tested and returned HTTP 200 on 2026-08-19
What is the Placehold.co API?
Placehold.co is a free, key-free placeholder image API that generates a solid-colour image at any dimensions from a URL, with customisable background, text colour, caption and output format.
This is the classic grey-box placeholder, generated on demand from the URL. Unlike photo-based placeholder services it produces a plain image with the dimensions written on it, which is exactly what you want when checking layout and aspect ratios rather than evaluating real imagery.
It supports SVG output, which is worth using during development: an SVG placeholder is a fraction of the size of a PNG, renders instantly, and scales without blurring.
Quick facts
- Base URL
https://placehold.co- Authentication
- No API key required.
- Rate limit
- No published limit.
- Pricing
- Free, including commercial use.
- CORS
- Enabled — callable directly from browser JavaScript
- Official docs
- Read the docs
How to use the Placehold.co API
Every request below was executed against the live API on 2026-08-19, and the response shown is the real body it returned — not an illustration.
1. Generate a placeholder image
GET https://placehold.co/600x400/png
curl 'https://placehold.co/600x400/png'const res = await fetch("https://placehold.co/600x400/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://placehold.co/600x400/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 |
|---|---|---|---|
<width>x<height> | path | Required | Dimensions. A single number produces a square. 600x400 |
<bg>/<fg> | path | Optional | Background and text colours as hex without the hash. 000000/FFFFFF |
<format> | path | Optional | png, jpg, gif, webp or svg as a file extension. png |
text | string | Optional | Custom caption. Use + for spaces. Hello+World |
font | string | Optional | Font family for the caption. roboto |
Response fields
(image)image- The response body is the generated image, not JSON.
What you can build with the Placehold.co API
- Block out layouts and check aspect ratios during development
- Fill wireframes and mockups with correctly sized boxes
- Test responsive image behaviour at specific dimensions
- Generate lightweight SVG placeholders that load instantly
Common errors and how to fix them
Text not appearing
Spaces were not encoded.
Fix: Use + or %20 for spaces in the text parameter.
Colours ignored
Hex values included a # character.
Fix: Pass colours as bare hex, e.g. /000000/FFFFFF.
Placehold.co API — frequently asked questions
Is there a free placeholder image API?
Yes. Placehold.co generates placeholder images at any size directly from a URL, with no API key and no signup.
Can I customise the colours and text?
Yes. Put background and foreground hex colours in the path without the hash, and pass a `text` parameter with + for spaces.
Should I use SVG or PNG placeholders?
SVG during development — it is far smaller, renders instantly and scales cleanly. Use PNG only if something in your pipeline cannot handle SVG.
How is this different from Lorem Picsum?
Placehold.co generates plain coloured boxes with the dimensions written on them, which is better for checking layout. Lorem Picsum returns real photographs, which is better for judging a design's final feel.
Tools that pair with this API
Image Cropper
Crop images online to an exact rectangle with pixel-precise x, y, width and height inputs or aspect-ratio presets. Free, private and browser-based.
Color Picker
Pick any color and get its HEX, RGB and HSL values instantly. Free online color picker with shades, tints and one-click copy for designers and developers.
Placehold.co is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-19; always check the official documentation before relying on this API in production, as terms and limits can change.