Placeholder images let developers build and test page layouts at full fidelity without waiting for real content. Here is exactly how to use them in HTML, CSS, and responsive workflows — and when to choose self-generated images over URL-based services.
Generate a placeholder image with the Placeholder Image Generator, download the PNG or JPG, place it in your project's asset folder, and reference it like any image:
<img src="/assets/placeholder-1200x630.png" alt="Hero banner placeholder" width="1200" height="630">Copy the data URL from the generator and paste it directly into your src attribute or CSS:
<img src="data:image/png;base64,iVBOR..." alt="Thumbnail placeholder">background-image: url(data:image/png;base64,iVBOR...);Reference a third-party service URL directly:
<img src="https://placehold.co/300x200/222/ccc" alt="placeholder">| Factor | Self-Generated (Our Tool) | URL Services (placeholder.com, placehold.co) | Lorem Picsum (Photos) |
|---|---|---|---|
| Offline support | ✓ Works after page load | ✗ Requires internet always | ✗ Requires internet always |
| External dependency | ✓ None — files are local | ✗ Depends on third-party server | ✗ Depends on Unsplash CDN |
| Setup effort | ~Generate + download + place in project | ✓ Just type URL | ✓ Just type URL |
| CI/CD friendly | ✓ Files committed to repo | ✗ Tests fail without internet | ✗ Tests fail without internet |
| Custom colors | ✓ Any hex color | ✓ Hex in URL path | ✗ Real photos only |
| Realistic content | ✗ Solid color rectangles | ✗ Solid color rectangles | ✓ Real photography |
| Rate limits | ✓ None | ~Fair use / rate limited | ~Fair use / rate limited |
| Data URL option | ✓ One-click copy | ✗ Not available | ✗ Not available |
| Element | Width | Height | Usage |
|---|---|---|---|
| OG / Social preview | 1200 | 630 | Facebook, LinkedIn, Twitter link preview cards |
| Hero banner | 1920 | 1080 | Full-width hero sections above the fold |
| Blog featured image | 800 | 450 | Post thumbnails, CMS featured image slots |
| Card thumbnail | 300 | 200 | Grid cards, product listings, search results |
| Avatar | 200 | 200 | User profile images, team pages, comment sections |
| Sidebar banner | 300 | 250 | Ad units, promotional widgets, CTAs |
| Email header | 600 | 200 | HTML email header banners (600px max width standard) |
| Mobile hero | 375 | 250 | Mobile-first hero images at iPhone width |
| Favicon source | 512 | 512 | Source file for generating all favicon sizes |
| App icon | 1024 | 1024 | iOS App Store and Google Play Store icons |
Responsive layouts need images at multiple breakpoints. Here is how to test them properly with placeholders:
Because each placeholder displays its dimensions as text, you can immediately verify that the correct image is loading at each breakpoint without inspecting network requests.
Generate placeholder images at any dimension — PNG, JPG, or data URL. No signup, runs in your browser.
Open Placeholder Image Generator