Getting Started
FreePlaceholder.com is a free API for generating placeholder images and avatars. There are no accounts, no API keys, and no rate limits. Just construct a URL and use it anywhere images are accepted.
Placeholder Images
Add dimensions to the URL to generate a placeholder image.
https://freeplaceholder.com/{width}x{height}For example, https://freeplaceholder.com/600x400 generates a 600x400 SVG image.
Choose a format
Append a file extension to choose the output format:
| Extension | Format |
|---|---|
| .svg | SVG (default) |
| .png | PNG |
| .jpg | JPEG |
| .webp | WebP |
Custom colors
Add hex colors (without #) using query parameters:
https://freeplaceholder.com/600x400?bg=3b82f6&text-color=ffffffIf no colors are provided, the API generates a unique, accessible color pair from the URL.
Custom text
https://freeplaceholder.com/600x400?text=Hello+World&text-size=32Avatars
Generate avatar images from any name:
https://freeplaceholder.com/avatar/John+DoeThis produces a square avatar with the initials "JD" and a deterministic color palette. Append .png, .jpg, or .webp for raster formats. Use ?size=256 to control dimensions (default: 128px, max: 1024px). Use ?rounded=full for a circular avatar.
Snippet images (Open Graph)
Build share-card style images with **title**, **subtitle**, **call to action**, and an optional **logo** URL.
https://freeplaceholder.com/snippet
https://freeplaceholder.com/snippet.pngDefault size is **1200×630** (Open Graph). Override with ?width= and ?height= (same min/max as placeholder images). Default output format is **PNG**; use /snippet.svg, /snippet.webp, etc., or ?format=.
Snippet query parameters
| Parameter | Description |
|---|---|
| title | Main headline |
| subtitle | Secondary line |
| cta | Call-to-action label (shown in a button-style area) |
| logo | Public https URL of a raster logo (PNG, JPEG, GIF, or WebP) |
All Tailwind-style parameters for colors, gradients, typography, filters, and borders apply the same way as placeholder images (except text, which is not used on snippets).
TypeScript URL builder
Use snippetUrl() from @freeplaceholder/core (or any framework package) the same way as placeholderUrl():
import { snippetUrl } from "@freeplaceholder/core";
const ogImage = snippetUrl({
title: "Ship faster",
subtitle: "API-first placeholders",
cta: "Read the docs",
format: "png",
});Limits
- Max image dimensions: 4096 x 4096
- Max avatar size: 1024 x 1024
- Supported formats: SVG, PNG, JPEG, WebP
Lazy Loading
All framework components support native lazy loading via the lazy prop. When enabled (the default), the component renders with loading="lazy" and shows a lightweight inline SVG placeholder matching the bg color while the full image loads.
<Placeholder width={600} height={400} bg="3b82f6" /> {/* lazy by default */}
<Placeholder width={600} height={400} lazy={false} /> {/* eager loading */}Query Parameters
All query parameters are named after Tailwind CSS utility classes.
| Parameter | Description | Accepted Values | Default |
|---|---|---|---|
| bg | Background color | Any hex (without #) | Auto |
| gradient | Gradient direction | to-t, to-tr, to-r, to-br, to-b, to-bl, to-l, to-tl, radial | — |
| from | Gradient start color | Any hex (without #) | — |
| via | Gradient middle color | Any hex (without #) | — |
| to | Gradient end color | Any hex (without #) | — |
| text-color | Text color | Any hex (without #) | Auto |
| text | Custom text overlay | Any string | {W}×{H} |
| text-size | Font size | Any number in px | Auto |
| text-align | Text alignment | left, center, right | center |
| text-transform | Text casing | uppercase, lowercase, capitalize, none | none |
| text-decoration | Text decoration | underline, overline, line-through, none | none |
| letter-spacing | Letter spacing | tighter, tight, normal, wide, wider, widest, or px | Auto |
| font-weight | Font weight | thin, extralight, light, normal, medium, semibold, bold, extrabold, black | medium |
| opacity | Opacity | 0–100 | 100 |
| blur | Gaussian blur | 0–100 (px) | 0 |
| brightness | Brightness | 0–200 (100 = normal) | 100 |
| contrast | Contrast | 0–200 (100 = normal) | 100 |
| hue-rotate | Hue rotation | 0–360 (degrees) | 0 |
| invert | Invert colors | true, false | false |
| saturate | Saturation | 0–200 (100 = normal) | 100 |
| sepia | Sepia tone | true, false | false |
| grayscale | Grayscale | true, false | false |
| border | Border width | Any number in px | 0 |
| border-color | Border color | Any hex (without #) | Auto |
| border-style | Border style | solid, dashed, dotted, double, none | solid |
| rounded | Border radius | none, sm, md, lg, xl, 2xl, 3xl, full, or px | none |
| format | Output format | svg, png, jpg, webp | svg (placeholders) / png (snippets) |
| title | Snippet headline | Any string | — |
| subtitle | Snippet subheading | Any string | — |
| cta | Snippet call to action | Any string | — |
| logo | Snippet logo image URL (https, raster only) | URL string | — |
| width | Snippet width | 1–4096 | 1200 |
| height | Snippet height | 1–4096 | 630 |
| size | Avatar square dimensions | Any number in px (max 1024) | 128 |
