Placeholder Image Generator
Generate placeholder images with custom dimensions, colors, and text for web design and development.
Image Settings
Preview
Image URLs
https://placehold.co/800x600/cccccc/666666?text=800x600https://via.placeholder.com/800x600/cccccc/666666?text=800x600https://dummyimage.com/800x600/cccccc/666666&text=800x600What Is a Placeholder Image?
A placeholder image is a temporary graphic used during web design and development to represent the size and position of a final image that has not been produced yet. Rather than leaving an empty space or spending time searching for a suitable stock photo, designers and developers use placeholder images to establish layout structure, test responsive behavior, and communicate intended dimensions to stakeholders and teammates.
Placeholder images are an essential part of modern web workflows. They allow front-end developers to build out page templates before the content team delivers final assets, and they let designers share wireframes and mockups with realistic proportions. Whether you are building a blog, an e-commerce product grid, a portfolio site, or a marketing landing page, placeholder images keep the development cycle moving without blocking on final photography or illustration.
This free online placeholder image generator creates SVG-based placeholder images entirely in your browser. You can set any width and height up to 4000 pixels, choose background and text colors using a color picker, and enter optional custom label text. The tool also generates ready-to-use URLs for three popular external placeholder services — placehold.co, via.placeholder.com, and dummyimage.com — so you can embed placeholder images directly in your HTML without downloading any files.
Unlike raster formats such as PNG or JPEG, SVG placeholders are infinitely scalable, produce no pixelation at any display resolution, and are extremely lightweight in file size. The generated SVG contains only a background rectangle and a centered text label, making it ideal for rapid prototyping, component documentation, and design system mockups.
How the Generator Works
The placeholder image generator takes your inputs — width, height, background color, text color, and optional label text — and builds an inline SVG document using JavaScript template literals. The SVG is then percent-encoded into a data URI so it can be set directly as an image src attribute without any server requests or file uploads.
Two values are computed automatically from the width and height. The font size of the centered label is scaled to one-tenth of the image's shorter dimension, ensuring the text is always proportionate and legible regardless of the image's aspect ratio. The aspect ratio is computed by dividing width by height and displayed to two decimal places, helping you confirm the placeholder matches the intended layout slot.
When no custom text is entered, the label defaults to the dimension string — for example, 800x600 — which immediately communicates the intended image size to anyone reviewing a design. If you enter custom text such as "Hero Banner" or "Product Photo", it replaces the dimension label in both the SVG preview and all generated service URLs.
The SVG structure uses three XML elements: the root <svg> element sets the canvas width and height; a <rect> element fills the entire canvas with the chosen background color; and a <text> element places the label at the exact center using dominant-baseline="middle", text-anchor="middle", and coordinates of x="50%" and y="50%". All rendering happens client-side — no data leaves your browser.
Font Size and Aspect Ratio Formulas
Where:
- fontSize= Font size of the centered SVG label in pixels
- width= Desired image width in pixels (input, 1–4000)
- height= Desired image height in pixels (input, 1–4000)
- aspectRatio= Width divided by height, rounded to 2 decimal places
SVG Data URI Format Explained
The generator produces a data URI — a URL scheme that embeds file content directly in the URI string rather than pointing to an external resource. For SVG images the format is data:image/svg+xml,<percent-encoded SVG>. Because the entire image is self-contained in the URL, it works wherever a regular image URL is accepted: HTML <img> tags, CSS background-image properties, and JavaScript Image objects.
SVG data URIs are especially efficient for placeholder images because SVG is a text-based format. The full image description — rectangle fill, text position, font size, and color — fits in a compact XML string. The encodeURIComponent() function replaces characters that are unsafe in URLs (spaces, quotes, angle brackets, and others) with percent-encoded sequences, producing a URL-safe string that modern browsers render immediately without additional network requests.
The generated SVG contains exactly three XML elements and remains well under one kilobyte for any reasonable placeholder size. Contrast this with a PNG placeholder at 800×600 pixels, which would typically be 5–20 KB even when fully compressed. The size advantage of SVG data URIs makes them particularly valuable in performance-sensitive contexts like component libraries or documentation sites that render dozens of placeholders on a single page.
For situations where a downloadable file is preferred over an inline URI — such as adding the placeholder to a shared assets folder or committing it to version control — use the Download SVG button. This creates a Blob from the SVG string and triggers a browser download, saving the file as placeholder-WxH.svg with the actual pixel dimensions in the filename.
External Placeholder Image Services
In addition to the locally generated SVG, this tool provides copy-ready URLs for three established external placeholder image services. These services host placeholder images on their own servers and return them via simple, predictable URL patterns, making them easy to embed in any project without storing any files locally.
The URL for each service encodes the image dimensions, background color (hex without the # prefix), text color, and display text. The generator strips the leading # from each hex color using .slice(1) and percent-encodes the display text before constructing the URLs. You simply choose your settings and copy the resulting URL.
| Service | URL Pattern | Notes |
|---|---|---|
| placehold.co | placehold.co/WxH/bg/text?text=… | Modern service; supports custom fonts and retina sizes |
| via.placeholder.com | via.placeholder.com/WxH/bg/text?text=… | Classic service widely referenced in tutorials |
| dummyimage.com | dummyimage.com/WxH/bg/text&text=… | Long-running service; supports GIF, PNG, and JPEG output |
Using an external service has trade-offs worth considering. On the positive side, you get a short, permanent URL that works in any browser or email client without bundling files, and some services offer extra features like custom typography or multiple output formats. On the negative side, you introduce an external dependency — if a service experiences downtime or changes its URL scheme, embedded placeholders will break. For development environments without reliable internet access, the locally generated SVG data URI is the more robust choice.
Use Cases and Best Practices
Placeholder images serve a wide range of purposes across design and development workflows. Using them effectively — and replacing them at the right time — keeps projects moving and prevents common layout problems.
- Wireframing and mockups: Add placeholder images in design tools like Figma or Adobe XD to communicate image positions and proportions to clients before final photography is available. Labeled placeholders ("Hero Image", "Team Photo") convey content intent alongside dimensions.
- Front-end component development: Embed placeholder URLs in React, Vue, Next.js, or Angular components to build and test layouts with realistic content structure, independent of the backend or CMS that will eventually supply real images.
- Content management system (CMS) templates: Set placeholder images as default fallbacks for CMS page templates when authors have not yet uploaded media, preventing broken-image icons from appearing on live previews.
- Style guides and component documentation: Use dimensioned placeholders in Storybook or similar documentation tools to illustrate image slots, expected aspect ratios, and responsive behavior alongside each component.
- Email template development: Some email clients block external images by default. SVG data URI placeholders load inline and preserve layout integrity during development, even in offline preview environments.
- Responsive and edge-case testing: Generate placeholders at unusual dimensions — very wide banners, very tall portraits, tiny thumbnails — to test how your layout handles overflow, text truncation, and image scaling edge cases.
When selecting dimensions, match the placeholder's aspect ratio to the final image slot as closely as possible. A mismatched placeholder causes layout shifts when real content loads, increasing the page's Cumulative Layout Shift (CLS) score and degrading user experience. Use the standard presets — 1920×1080 (16:9), 1280×720 (16:9), 800×600 (4:3), or 400×400 (1:1) — to align with common media formats from the start.
For color choices, the default neutral gray palette (var(--card-border)ccc background, var(--muted)666 text) is deliberately unobtrusive and universally legible. If your project has a defined brand color system, setting the placeholder background to a brand color can make mockups more presentable in client reviews and design critiques without adding any complexity to the workflow.
Worked Examples
HD Hero Banner Placeholder (1920×1080)
Problem:
Generate a placeholder for a 1920×1080 full-width hero section with default gray colors.
Solution Steps:
- 1Set width = 1920, height = 1080
- 2Font size = Math.min(1920, 1080) / 10 = 1080 / 10 = 108 px
- 3Aspect ratio = 1920 / 1080 = 1.78 (rounded to 2 decimal places)
- 4No custom text entered, so label defaults to '1920x1080'
- 5Result: SVG with a var(--card-border)ccc background, centered '1920x1080' label in 108 px var(--muted)666 text, aspect ratio 1.78
Result:
1920×1080 placeholder, font-size 108 px, aspect ratio 1.78
Square Product Image Placeholder (400×400)
Problem:
Create a 400×400 square placeholder labeled 'Product Photo' for an e-commerce grid.
Solution Steps:
- 1Set width = 400, height = 400
- 2Font size = Math.min(400, 400) / 10 = 400 / 10 = 40 px
- 3Aspect ratio = 400 / 400 = 1.00
- 4Custom text 'Product Photo' entered, replacing the default dimension label
- 5Result: SVG with centered 'Product Photo' label in 40 px text, aspect ratio 1.00
Result:
400×400 placeholder, font-size 40 px, aspect ratio 1.00, labeled 'Product Photo'
Classic Blog Featured Image (800×600)
Problem:
Create an 800×600 placeholder for a traditional 4:3 blog featured image slot.
Solution Steps:
- 1Set width = 800, height = 600
- 2Font size = Math.min(800, 600) / 10 = 600 / 10 = 60 px
- 3Aspect ratio = 800 / 600 = 1.33 (rounded to 2 decimal places)
- 4No custom text entered, label defaults to '800x600'
- 5Result: SVG with centered '800x600' label in 60 px text, aspect ratio 1.33
Result:
800×600 placeholder, font-size 60 px, aspect ratio 1.33
Portrait Book Cover Slot (600×900)
Problem:
Generate a portrait-oriented 600×900 placeholder for a book cover or poster slot.
Solution Steps:
- 1Set width = 600, height = 900
- 2Font size = Math.min(600, 900) / 10 = 600 / 10 = 60 px
- 3Aspect ratio = 600 / 900 = 0.67 (rounded to 2 decimal places)
- 4No custom text entered, label defaults to '600x900'
- 5Result: SVG with centered '600x900' label in 60 px text, aspect ratio 0.67
Result:
600×900 placeholder, font-size 60 px, aspect ratio 0.67
Tips & Best Practices
- ✓Use the 1920×1080 preset for hero sections and video thumbnails to match standard HD screen resolution.
- ✓Match your placeholder's aspect ratio to the final image slot to prevent Cumulative Layout Shift (CLS) when real content loads.
- ✓Enter descriptive custom text like 'Profile Photo' or 'Team Banner' to make placeholders self-documenting in shared design mockups.
- ✓Copy the data URI directly into your CSS as a background-image value for component-level placeholder testing without any file imports.
- ✓Use high-contrast color combinations — such as a dark background with white text — to make placeholder labels easy to read in client presentations and screenshots.
- ✓For responsive layout testing, generate the placeholder at the largest size your breakpoint will display, then let CSS handle scaling down.
- ✓When sharing mockups externally or via chat, prefer external service URLs over data URIs — they are shorter, cleaner, and render in any browser automatically.
- ✓Download the SVG file and commit it to your project's assets folder for offline-first development environments, intranet applications, or air-gapped build systems.
Frequently Asked Questions
Sources & References
Last updated: 2026-06-05
Help us improve!
How would you rate the Placeholder Image Generator?
Editorial Note
MyCalcBuddy Editorial Team
This page is maintained as an educational calculator reference.
Formula Source: Standard Mathematical References
by Various