
Placeholder Image Generator
Generate custom placeholder images with solid colors, gradients, patterns, and text. Download as PNG instantly.
Last reviewed: April 2026New to this tool? Click here for instructions
Quick Presets:
Generate solid, gradient, text-labeled, or patterned placeholder images of any common size — from 320x180 hero stubs to 1200x630 Open Graph cards — entirely in the browser, with zero network requests and zero rate limits.
What This Tool Does
This tool generates raster placeholder images directly in your browser using the HTML5 Canvas API. You specify a width and height, choose a fill style (solid color, two-color gradient, repeating pattern, or text overlay), and the tool produces a downloadable PNG along with a copy-ready data URI you can paste straight into HTML, CSS, or a Markdown file. The output covers the dimensional and visual variety needed for mockups, wireframes, design comps, and "missing image" fallbacks across web, mobile, and print contexts.
Every common social and ad-tech dimension is one click away through the preset chips: 1200x630 for Open Graph and Twitter cards, 1080x1080 for Instagram square, 1080x1920 for Stories and Reels, 1280x720 for YouTube thumbnails, 1500x500 for X (Twitter) headers, 728x90 for IAB leaderboard ads, and 300x250 for medium rectangle units. Custom dimensions up to 4096x4096 are supported via the width and height inputs — large enough for almost any hero banner, retina-density poster, or print bleed area.
The tool runs 100% client-side. Once the page loads, nothing you enter — dimensions, colors, label text — leaves your browser. There's no API, no quota, no rate limit, and no need to reach a remote placeholder service like placehold.co or dummyimage.com that may go down, change behavior, or be blocked by corporate firewalls. 🔒
How to Use It
The workflow is short and most users land on a usable image within a few seconds, but each mode unlocks specific styling controls worth knowing about.
Pick a Mode
The four mode chips at the top — Solid, Gradient, Text, Pattern — determine which fields appear below. Solid renders a single fill color with optional label text; Gradient adds a second color picker and a direction selector (horizontal, vertical, diagonal, radial); Text is identical to Solid but emphasizes the label workflow; Pattern hides the gradient color but adds a pattern-type selector for stripes, dots, grid, or crosshatch overlays.
Set Dimensions
Type the target pixel dimensions directly into the Width and Height inputs, or click any preset chip to pre-fill both values. Presets are labeled with their canonical names (OG Image, Instagram Square, YouTube Thumb, Hero 1920x600) so you don't need to remember exact aspect ratios. Custom values up to 4096 pixels per dimension regenerate the canvas instantly.
Customize Colors and Text
The Background Color picker uses the browser's native color input — type a hex value directly, or use the eyedropper if your platform supports it. For Gradient mode, set both color stops independently. Text Overlay accepts any string up to 80 characters; leave it blank and the tool auto-fills the canvas with the current dimensions (e.g., 320 x 180), which is the most common placeholder convention. Font size auto-scales relative to the canvas size when you leave it at 0.
Download or Copy
Click Download PNG to save the image as placeholder-{width}x{height}.png. Click Copy Data URL to copy a base64-encoded data:image/png;base64,... string straight to your clipboard — paste it directly into a CSS background-image: url(...) declaration or an HTML <img src="..."> attribute. The image info line below the canvas displays the rendered size in kilobytes so you can judge whether the result is inline-friendly or should be served as a separate file.
Worked Example: A 320x180 Hero Placeholder vs. a 1200x630 OG Card
To illustrate the difference dimensions and styling make, here's a side-by-side construction of two very different placeholders for the same hypothetical article — one for the in-page hero image, one for the social-share Open Graph card.
The 320x180 Hero Placeholder
- Click the Thumbnail preset. This pre-fills Width to 400 and Height to 300 — close, but not quite right. Manually set Width to
320and Height to180to match a 16:9 video-aspect thumbnail. - Switch to Solid mode (it's the default). Set the Background Color to
#6366f1(indigo), keep Text Color at#ffffff(white), leave Font Size at0for auto-sizing. - Type the label. Enter
Article Heroin the Text Overlay field. The canvas immediately re-renders with the centered label. - Inspect the data URI size. The info line reads roughly
320 x 180 - approx 3 KB PNG. At under 4 KB this is small enough to inline as a data URI in your HTML without ballooning page weight. - Click Copy Data URL. Paste the result directly into your HTML:
<img src="data:image/png;base64,iVBORw0KGgo..." alt="hero placeholder" width="320" height="180">. The image renders without any network request.
The 1200x630 OG Card
- Click the OG Image preset. Width and Height auto-fill to 1200 and 630.
- Switch to Gradient mode. Set Color 1 to
#6366f1(indigo), Color 2 to#10b981(emerald), and Direction to Diagonal. The canvas re-renders with a smooth indigo-to-emerald wash. - Enter the label. Type
Article Title Goes Herein the Text Overlay field. The auto-sized font computes to roughly 75 pixels for the 1200-pixel-wide canvas. - Compare data sizes. The info line now reads roughly
1200 x 630 - approx 12 KB PNG— four times the file size of the hero. At 12 KB this exceeds the practical inline-data-URI threshold, so download it instead. - Click Download PNG. The browser saves
placeholder-1200x630.pngto your default downloads folder. Upload this to your CMS as the temporaryog:imagewhile waiting on real artwork.
Key takeaway: the same tool produces two very different deliverables for the same article — a tiny inline data URI for the in-page hero, and a downloadable raster file for the social card — because the dimensions dictate which delivery method is appropriate. Always check the kilobyte count before deciding to inline.
Common Use Cases
Storybook and Component Library Mocks
Storybook stories for image-bearing components (cards, avatars, hero banners, media tiles) need representative imagery to render meaningfully in isolation. Real production photography is rarely available during early component development, and pulling from a live CDN couples Storybook to network availability. A locally generated placeholder data URI dropped directly into the component's props in Component.stories.tsx produces a deterministic, network-independent render that ships cleanly to Chromatic, Loki, or any visual regression testing pipeline. Designers can scan a Storybook index and immediately see component variation at the correct dimensions and aspect ratios.
Wireframes and Design Comps
Before client assets arrive — and they always arrive later than the deadline assumes — designers and developers need to build out page layouts using stand-in imagery that communicates intent without misrepresenting final content. Generic placeholders with labels like "Hero 1920x600" or "Product Tile 400x400" preserve the layout's structural integrity while making explicit that the imagery is temporary. Stakeholders reviewing a wireframe see "this is placeholder content" at a glance and don't mistake the stand-in for finished art. Compare this with using real photos: clients invariably critique the photo choice rather than the layout, which derails the review.
Content Management System Testing
When testing how a CMS renders articles, products, or listings, you need varied images covering edge cases: portrait and landscape ratios, very wide banners, very tall vertical cards, monochrome and high-contrast color schemes. Generating a dozen placeholders programmatically — each labeled with its own dimensions — is faster than sourcing a dozen real photographs and reveals layout bugs that uniformly-sized stock images would mask. Test a product grid by stuffing it with 50 generated 400x400 squares of varying background colors; rendering glitches surface immediately.
Missing-Image Fallback Strategy
Production systems eventually encounter records with no associated image: a product without uploaded photography, a user profile without an avatar, an article whose hero image 404s. A generated SVG or PNG placeholder served as a fallback is preferable to a broken image icon or a layout collapse. The Aspect Ratio Calculator helps confirm that the fallback's dimensions match the slot it fills, preventing layout shift when the real image eventually loads.
Edge Cases and Limitations
Several technical constraints shape how placeholders behave in real deployment contexts. Understanding these prevents surprises during integration.
Data URI Size Limits
RFC 2397 doesn't formally cap data URI length, but browsers do. Chrome and Firefox handle data URIs up to roughly 2 MB without complaint; legacy Internet Explorer capped at 32 KB. The bigger practical issue is HTML payload bloat — every byte of a data URI lives inline in your HTML and gzips less efficiently than a referenced binary file. Keep inline data URIs under 4 KB; above that, serve the placeholder as a separate file referenced via <img src> instead.
SVG vs Raster Tradeoffs
This tool outputs PNG (raster) because the Canvas API is raster-native. SVG placeholders, by contrast, are vector — they scale to any size without quality loss and typically weigh a fraction of an equivalent raster image (200-800 bytes vs. 3-12 KB). Use the canvas-to-PNG output here when the consuming system requires raster (image-processing pipelines, formats that don't support SVG, design tools that prefer raster comps). For pure web use where SVG is supported, a hand-written SVG placeholder is usually smaller and crisper.
The CSS aspect-ratio Property
Modern browsers support aspect-ratio: 16 / 9; in CSS, which lets you reserve layout space without setting an explicit pixel height. Combined with a low-quality image preview (LQIP) data URI as background-image, this eliminates the need for a separately-sized placeholder file in many cases. The aspect-ratio property has been baseline since 2021 and is supported in every evergreen browser; for older browsers, the classic "padding-bottom percentage" trick still works as a fallback.
Lazy-Loaded Image Placeholders
When using loading="lazy" on an <img>, the browser delays fetching the image until it nears the viewport. During that delay, the slot is empty by default — unless you supply a placeholder via poster-style data URI, a CSS background, or a tiny SVG placeholder rendered as the initial src. The onload handler can then swap to the full-quality image. This pattern, common in Next.js Image and Gatsby's gatsby-image components, prevents the "blank rectangle followed by sudden pop-in" effect.
Blurhash and SQIP Alternatives
For preview-during-load use cases specifically, dedicated low-quality preview techniques outperform generic placeholders: blurhash encodes an image into a 20-30 character string that decodes to a soft color-matched blur; SQIP (SVG-based Quick Image Placeholder) uses primitive shapes to approximate the source image as a tiny SVG. These produce previews that match the eventual image's color palette, making the transition feel natural. Generic placeholders are a better fit for layout-stage mockups where no real image exists yet.
Behind the Scenes: The Placeholder Image History and Canvas Pipeline
A Brief History of Placeholder Services
The lineage of online placeholder generators begins with placehold.it, launched in 2009 as a simple HTTP service: request placehold.it/300x200 and receive a gray PNG with the dimensions printed across it. The service shut down in 2020 but was succeeded by placehold.co with the same URL pattern and added color and text controls. dummyimage.com, launched in 2007 by Russell Heimlich, offered similar functionality with finer-grained color controls and remains operational today. placekitten.com (2010) and placedog.net introduced themed photo placeholders, though placekitten formally retired in 2025. picsum.photos, launched in 2017 by David Marby, serves randomized stock photographs from a curated pool and remains one of the most popular live-photo placeholder services in active development.
Why a Client-Side Tool Beats a Remote Service
Remote placeholder services have several recurring failure modes: the service goes down or changes URL patterns (placehold.it → placehold.co broke many tutorials), corporate firewalls block external image hosts, CORS policies prevent canvas-based manipulation of the returned image, and CDN latency adds visible delay to design previews. A purely client-side generator like this one sidesteps every one of those failure modes — the placeholder is materialized in the browser the instant you change a setting, and the only network dependency is the one-time initial page load.
The Canvas API Pipeline
The full generation pipeline runs through four Canvas API stages. First, an HTMLCanvasElement's width and height are set to the requested dimensions; this allocates the underlying pixel buffer. Second, a 2D rendering context is obtained via canvas.getContext('2d'), exposing the drawing primitives. Third, the fill operation paints the background: fillRect for solids, createLinearGradient or createRadialGradient for gradients, and a loop of strokeStyle + moveTo/lineTo + stroke calls for patterns. Fourth, if a text overlay is requested, fillText renders the label using a computed font size, with textAlign: 'center' and textBaseline: 'middle' for perfect centering and a subtle shadow for legibility on busy backgrounds.
From Canvas to Data URI to Download
The final stage converts the raster buffer to a downloadable PNG via canvas.toDataURL('image/png'), which returns a base64-encoded data URI of the form data:image/png;base64,iVBORw0KGgo.... This same string is used three ways: as the href on a hidden <a download> element to trigger a download, as the value copied to the clipboard via the Clipboard API for the "Copy Data URL" action, and to estimate the resulting file size (data URI length × 0.75, divided by 1024 yields kilobytes). The conversion runs in O(width × height) — fast enough to feel instant even at the 4096x4096 ceiling.
Visual Comparison: Common Placeholder Dimensions and File Sizes
Comparison: This Tool vs. Placeholder Services and LQIP Techniques
The placeholder ecosystem spans live-photo APIs, generic dimension labelers, and low-quality preview generators. Each occupies a different niche; choosing the right one depends on whether you need a generic dimension stand-in, a representative-looking color preview, or a real photograph.
| Approach | Output | Network Required | Typical Size | Best For | Limitation |
|---|---|---|---|---|---|
| This tool (Canvas) | PNG / data URI | No (after page load) | 3-30 KB | Mockups, design comps, CMS testing | Raster output only; not vector-scalable |
| placehold.co | PNG (via HTTP) | Yes (every request) | Service-controlled | Quick HTML tutorials, demos | External dependency; CORS-restricted; goes down |
| dummyimage.com | PNG, GIF, JPG (via HTTP) | Yes | Service-controlled | Quick color-specified placeholders | External dependency; URL-parameter syntax only |
| picsum.photos | Real photographs (via HTTP) | Yes | 50-500 KB | Mockups needing realistic imagery | Photos are random; legal/attribution considerations |
| Blurhash | Decoded canvas blur | No (post-encoding) | 20-30 byte string | Loading-state preview matching final image | Requires encoder step on real image first |
| LQIP (low-quality preview) | Tiny JPG (20-30px wide) | No (inline) | 200 bytes - 2 KB | Progressive image loading | Color matches final but is heavily pixelated |
| SQIP | SVG with primitive shapes | No (inline) | 800 bytes - 4 KB | Stylized loading preview | Encoder is heavy; requires source image |
| Unsplash Source | Real photographs (via HTTP) | Yes | 100-800 KB | Theme-tagged real photos (deprecated 2024) | Service deprecated; use Unsplash API instead |
For most design and development workflows, the right answer combines two approaches: this tool for layout-stage mockups where no real image exists yet, and blurhash or LQIP for production loading states once the real image is in hand. The remote placeholder services (placehold.co, dummyimage.com) remain useful for one-line examples in tutorials and documentation, where requiring readers to set up a local tool is overkill.