Blog
Custom Print on Demand Apparel — Free Storefront for Your Business
Wild & Free Tools

Placeholder Images for Web Development — How to Use Them Correctly

Last updated: April 20266 min readGenerator Tools

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.

Three Ways to Add Placeholder Images to Your Code

Method 1: Self-Generated File (Most Reliable)

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:

Method 2: Data URL (Zero Files)

Copy the data URL from the generator and paste it directly into your src attribute or CSS:

Method 3: URL Service (Quick but Dependent)

Reference a third-party service URL directly:

Self-Generated vs URL Services

FactorSelf-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

Essential Placeholder Sizes for Web Development

ElementWidthHeightUsage
OG / Social preview1200630Facebook, LinkedIn, Twitter link preview cards
Hero banner19201080Full-width hero sections above the fold
Blog featured image800450Post thumbnails, CMS featured image slots
Card thumbnail300200Grid cards, product listings, search results
Avatar200200User profile images, team pages, comment sections
Sidebar banner300250Ad units, promotional widgets, CTAs
Email header600200HTML email header banners (600px max width standard)
Mobile hero375250Mobile-first hero images at iPhone width
Favicon source512512Source file for generating all favicon sizes
App icon10241024iOS App Store and Google Play Store icons

Responsive Image Testing Workflow

Responsive layouts need images at multiple breakpoints. Here is how to test them properly with placeholders:

  1. Generate 3-4 sizes per image slot — e.g., 375x200 (mobile), 768x300 (tablet), 1200x500 (desktop), 1920x600 (wide)
  2. Use srcset and sizes attributes with your placeholder images to test browser selection logic
  3. Resize your browser window through each breakpoint and verify the correct placeholder loads (the dimension text on each image makes this easy to confirm)
  4. Check art direction — if your picture element uses different crops at different breakpoints, generate placeholders matching each crop ratio

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.

Developer Workflow: Placeholder to Production

  1. Generate placeholder images at every required dimension
  2. Build your layout — CSS grid, flexbox, responsive breakpoints all tested with real-size images
  3. Get design/stakeholder approval on layout and structure
  4. Replace each placeholder with its real image asset
  5. Resize images that do not match the exact required dimensions
  6. Compress images for production — target 80-150 KB for hero images, under 50 KB for thumbnails
  7. Convert to WebP with JPG fallback for optimal browser support and file size
  8. Crop images for art-directed responsive variants if needed

Common Mistakes

Tools for the Complete Image Pipeline

Generate placeholder images at any dimension — PNG, JPG, or data URL. No signup, runs in your browser.

Open Placeholder Image Generator
Launch Your Own Clothing Brand — No Inventory, No Risk