BYTETOOLS

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.

No API key requiredCORS enabledHTTPSFree tier

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
curl 'https://placehold.co/600x400/png'
JavaScript (fetch)
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);
Python (requests)
import requests

res = requests.get("https://placehold.co/600x400/png", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200
# 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/png

Parameters

ParameterTypeRequiredDescription
<width>x<height>pathRequiredDimensions. A single number produces a square. 600x400
<bg>/<fg>pathOptionalBackground and text colours as hex without the hash. 000000/FFFFFF
<format>pathOptionalpng, jpg, gif, webp or svg as a file extension. png
textstringOptionalCustom caption. Use + for spaces. Hello+World
fontstringOptionalFont 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

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.