Blank PFP

Placeholder Avatar API

Free, keyless placeholder avatars for development and production. Point an image tag at a URL and get a clean, deterministic SVG back in a few hundred bytes. Nothing to sign up for and nothing to install.

https://blankpfp.com/api/avatar

Live examples

Every image below is served live by the endpoint documented on this page.

Quick start

Drop the URL straight into an image tag. Sizes are in pixels and the default shape is a circle, so no extra styling is needed.

<img src="https://blankpfp.com/api/avatar/seed/alice/200" alt="Alice" width="200" height="200">

Or use it as a CSS background:

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background-image: url("https://blankpfp.com/api/avatar/seed/alice/96");
  background-size: cover;
}

In JavaScript, build the URL from whatever identifies the user:

avatar.src = 'https://blankpfp.com/api/avatar/seed/' + encodeURIComponent(user.email) + '/200';

URL syntax

All four forms accept an optional height. Append .json to any of them to get the metadata described below instead of the image.

URL What you get
/api/avatar/{width} Square avatar. The same URL always resolves to the same image.
/api/avatar/{width}/{height} Non-square canvas, useful for wide banners or story avatars.
/api/avatar/seed/{seed}/{width} Deterministic avatar derived from any seed string.
/api/avatar/id/{id}/{width} Deterministic avatar derived from a numeric id, such as a database row.

Deterministic seeds

A seed is hashed into one colour from a 48-entry palette, so the same seed always returns the same avatar with no database and nothing stored on disk. Use a username, an email address or a record id. Seeds containing spaces or symbols must be percent-encoded, and /api/avatar/id/ is a shortcut for numeric ids.

<img src="https://blankpfp.com/api/avatar/seed/alice/200" alt="alice">\n<img src="https://blankpfp.com/api/avatar/seed/bob/200" alt="bob">\n<img src="https://blankpfp.com/api/avatar/id/237/200" alt="record 237">

Query parameters

All parameters are optional and can be combined. An unrecognised value returns a 400 with a JSON explanation rather than a broken image.

Parameter Accepted values Default What you get
shape circle | rounded | square circle Outline of the avatar. A circle is the default because most platforms crop profile pictures that way.
pattern solid | grid | dots | diagonal | checker solid Texture drawn over the background. Use it to tell placeholder types apart at a glance.
bg #1E3A5F seed Background colour. Overrides the colour the seed would have picked.
fg #1E3A5F auto Colour of the initials, pattern lines or silhouette, picked automatically for contrast when omitted.
initials 1-2 - Up to two letters, digits or symbols drawn in the centre. A full name is reduced to its initials.
figure 1-15 - Silhouette id (1-15) or name, painted in fg over bg. Takes priority over initials, and a bare ?figure clears it.
outline 0 | 1 0
grayscale 0 | 1 0 Removes all colour. Useful for muted or disabled UI states.
blur 0-10 0 Gaussian blur radius. Blur stays inside the shape, so edges stay crisp.
random ?random=* - Any value. Returns a different avatar per value instead of a stable one.

Hex colours may be written with or without the leading hash, and three-digit shorthand such as #abc is expanded. Without bg the background comes from the seed; without fg the ink is picked automatically to stay readable. A blur above the maximum is capped rather than rejected, and initials never exceed two characters.

Silhouettes

The same fifteen bust silhouettes as the generator, addressable by id or by name. fg paints the silhouette and bg the backdrop, so one id looks different on every palette.

Solid fill

Hollow outline (outline=1)

Try it

Pick any avatar on this page, then change the parameters below. The preview and the code update as you go, and what you copy is exactly what the endpoint returns.

Preview

Background
Foreground

URL

Response formats

Images are returned as SVG, which keeps a typical avatar between 200 and 1000 bytes and stays sharp at any pixel density. Append .json to the same URL to read the resolved colours instead, which is handy for matching surrounding UI to the avatar.

{
  "ok": true,
  "mode": "seed",
  "seed": "alice",
  "width": 200,
  "height": 200,
  "shape": "circle",
  "pattern": "solid",
  "figure": null,
  "background": "#9CA3AF",
  "foreground": "#111827",
  "initials": null,
  "outline": false,
  "grayscale": false,
  "blur": 0,
  "format": "svg",
  "bytes": 266,
  "url": "https://blankpfp.com/api/avatar/seed/alice/200/200.svg",
  "info": "https://blankpfp.com/api/avatar/seed/alice/200/200.json"
}

Invalid requests answer with a 400 and a JSON body:

{
  "ok": false,
  "error": "invalid_parameters",
  "errors": ["pattern: expected one of solid, grid, dots, diagonal, checker"],
  "docs": "https://blankpfp.com/docs"
}

Caching and limits

Seeded URLs are a pure function of the address, so they are served with a one-year immutable cache header and an ETag. Put a CDN in front of your app and the images cost you nothing after the first request. Width and height may be anything from 16 to 2048 pixels; larger values are clamped rather than rejected, and the resolved size comes back in the JSON. To show a different image on every request, add ?random= followed by any value.

FAQ

Do I need an API key or an account?

No. There is no signup, no key and no quota. Every URL on this page works as-is for as long as the site is online.

Will the same URL always return the same avatar?

Yes. A seeded URL is a pure function of the address, so it is safe to hardcode in your markup, your database or your tests. Unseeded URLs are also stable per address, and ?random= is the explicit way to opt out.

Can I hotlink these images and use them commercially?

Yes. The images are generated on our own server from vector shapes, so there are no third-party photos, no licensing questions and no attribution requirement. Hotlink them directly or download them.

Why SVG, and what are the size limits?

An SVG avatar is typically a few hundred bytes, scales to any display density and can be recoloured with CSS. Width and height may be anything from 16 to 2048 pixels; anything larger is clamped to 2048.

Related tools