via.placeholder.com/photo

Photo placeholders

Describe what the picture should show, and get a fitting real photo cropped to the size you asked for. The same URL always gives the same photo. Every photo is CC0 or public domain.

URL syntax

https://via.placeholder.com/photo/<subject words>/<width>x<height>[@2x][.<format>][?seed=&grayscale&blur=&dpr=]

Segments can come in any order and every part is optional. A plausible photo URL never returns an error.

PartValuesDefault
subjectWords separated by -, _, +, ,, . or spaces, in one or more segments: espresso-bar-interior, food/pizza. Common synonyms and plurals are understood. Also ?q=.any photo
size1200x800, a single number for a square (/photo/cafe/800), or picsum-style /800/600. Also ?w= and ?h=. Max 2000 px per side; larger requests are scaled down to fit, keeping the aspect ratio.1200 × 800
format.jpg, .webp, .png, .avif (or ?format=). Anything else gets a JPEG.jpg
scale@1x to @3x (also @1.5x) at the end of any segment, or ?dpr=1 to 3. The suffix wins over ?dpr.1
seedAny short string. Picks another photo that matches equally well, still fixed for that URL.none
grayscaleFlag, no value needed.off
blur1 to 10; a bare ?blur means 2.off

The photo is cropped around its point of interest, so a wide banner and a square thumbnail of the same subject both look intentional. /photos/… works as an alias.

Examples

Retina and AVIF

A scale gives you the same photo, crop, blur and greyscale with more pixels:

<img src="https://via.placeholder.com/photo/coffee/400x300.webp"
     srcset="https://via.placeholder.com/photo/coffee/[email protected] 2x"
     width="400" height="300" alt="A cup of coffee">

Which subjects exist?

The library is curated and grows over time. Ask the service:

When no photo matches, you get a grey placeholder of the requested size with your subject words on it (still 200), so the page keeps its layout and the gap is obvious.

Response headers

HeaderValue
X-Photo-IdThe photo's ID, e.g. coffee-cup-02. Look it up under /photo/credits/<id>. Missing when no photo matched.
X-Photo-LicenseCC0 or public domain
LinkThe photo's source page, rel="license"
X-Placeholdervia.placeholder.com, plus the usual year-long caching and open CORS as for images

Determinism and detection