Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For simple, custom-sized placeholders, generate an SVG and use it inline or as a data: URI: it stays sharp at any size and adds no image request. Use Canvas when you need to draw a raster image or compose shapes and text in the browser, and use a hosted placeholder service when you want a convenient, shareable URL. If the real image will load later, framework image components may also require a small placeholder value of their own.

Choose a placeholder method that fits the job

“Dynamic placeholder image” can mean a neutral box with dimensions and a label, a generated image used in a test, or a low-detail preview while a remote photograph loads. Those needs point to different tools. Decide first whether the placeholder must be generated locally, whether it needs to be an actual PNG or JPEG, and whether it should be addressable by a URL.

Method Best for Trade-off
SVG string or data URI Flat backgrounds, labels, and simple geometry Compact and resolution-independent; escape user-provided text correctly.
Canvas Procedural drawing, gradients, raster output, or compositing Browser-native, but drawn text and shapes are not semantic to assistive technology.
Hosted placeholder URL Shared conventions and URL-addressable images Requires a network request and makes the page dependent on the service unless self-hosted.
Local image library Repeatable test fixtures or convenient generated samples Check whether its output is a local data URI or an external provider URL.

For an ordinary card skeleton or image slot, start with SVG. Canvas is justified when the output must be rasterized or assembled from runtime drawing operations. Choose a hosted endpoint when editors or multiple applications need the same URL pattern and you have considered its caching, privacy, rate-limit, and availability implications.

Generate an SVG placeholder without another request

An SVG can define a background rectangle and centered label in a few lines. This example produces a data URI, so the browser does not fetch a separate placeholder asset. The dimensions and label are parameters; the label is escaped before entering XML.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
AMUSIGHT Double-Sided Magnetic White Board with Stand, 16" x 12"
  • 【Multi-Use Double-Sided Whiteboard】-- Versatile and practical, this magnetic double-sided whiteboard with stand can be used on both sides, providing double the writing space for all your needs. The board can be placed on a desktop with the stand or hung on a wall. Whether you're brainstorming ideas, making to-do lists, or practicing your drawing skills, this whiteboard has got you covered
  • 【Smooth Writing & Easy to Clean】-- Enjoy a seamless writing experience on this dry erase board, as its smooth and durable writing surface allows your markers to glide effortlessly. When it's time to start fresh, cleaning is a breeze - simply wipe away your notes and drawings with a dry eraser or a soft cloth
  • 【Easy to adjust】-- The aluminum frame is sturdy, does not oxidize and scratch, remains clean as new after a long period of time, and is safer for writing and painting. The aluminum stand can be rotated up to 360 degrees, and upgraded knobs make it easier to lock the board, which conveniently adjusts to a comfortable angle, allowing the board to stand up securely
  • 【Value Set & Premium Quality Craftsmanship】-- The 16" x 12" Magnetic Double-sided dry erase board set comes with 8 magnetic dry erase markers (include 8 color), 8 magnetic pieces, 1 magnetic dry eraser and 1 marker holder. It is made from an aluminum frame and holder, making it lightweight and durable. This is handy to carry from room to room on their own
  • 【Widely Application Scenario】-- The magnetic dry erase board with stand is suitable for a wide range of scenarios, making it incredibly versatile. Whether you need it for personal use at home and collaborative work in the office, this whiteboard is the perfect tool to facilitate communication, creativity, and organization
function escapeXml(value) {
  return String(value).replace(/[<>&"']/g, ch => ({
    '&': '&amp;', '<': '&lt;', '>': '&gt;',
    '"': '&quot;', "'": '&apos;'
  })[ch]);
}

function makePlaceholder({ width, height, label = `${width} × ${height}`,
  background = '#e5e7eb', foreground = '#6b7280' }) {
  if (!Number.isInteger(width) || !Number.isInteger(height) ||
      width < 1 || height < 1 || width > 4000 || height > 4000) {
    throw new RangeError('Width and height must be integers from 1 to 4000.');
  }
  const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}">
    <rect width="100%" height="100%" fill="${escapeXml(background)}"/>
    <text x="50%" y="50%" fill="${escapeXml(foreground)}" font-family="sans-serif" font-size="${Math.max(12, Math.round(Math.min(width, height) / 12))}" text-anchor="middle" dominant-baseline="middle">${escapeXml(label)}</text>
  </svg>`;
  return `data:image/svg+xml,${encodeURIComponent(svg)}`;
}

document.querySelector('#preview').src = makePlaceholder({
  width: 640, height: 360, label: 'Product image'
});

Use <img id="preview" alt="Product image loading"> in the page. The alt text is HTML accessibility text; the SVG label is just pixels or vector drawing and should not be the only way important information is conveyed. The example caps dimensions to limit accidental memory or rendering costs; choose a smaller application-specific maximum if users control the inputs.

For a fixed asset, inline the SVG markup directly in the HTML or store the generated data URI where appropriate. For a reusable page component, derive dimensions and colors from trusted application settings. If labels or colors come from users, validate color inputs as well as escaping labels: XML escaping prevents markup injection but does not ensure a value is a valid color.

Draw a raster placeholder with Canvas

Canvas is a browser-native option when the placeholder needs more than a rectangle and label: for example, multiple shapes, a gradient, or a composition from images. Create the canvas, size it, draw through its 2D context, then export using toDataURL() or toBlob(). The following standalone example produces a PNG data URL.

<canvas id="placeholder" width="640" height="360"></canvas>
<script>
  const canvas = document.querySelector('#placeholder');
  const ctx = canvas.getContext('2d');
  if (!ctx) throw new Error('2D canvas context is unavailable');

  ctx.fillStyle = '#e5e7eb';
  ctx.fillRect(0, 0, canvas.width, canvas.height);
  ctx.fillStyle = '#6b7280';
  ctx.font = '24px sans-serif';
  ctx.textAlign = 'center';
  ctx.textBaseline = 'middle';
  ctx.fillText(`${canvas.width} × ${canvas.height}`, canvas.width / 2, canvas.height / 2);

  const pngDataUrl = canvas.toDataURL('image/png');
  // For an <img>: document.querySelector('#target').src = pngDataUrl;
</script>

toDataURL() returns a data: URL and defaults to PNG; formats that support it can take a quality argument. If you need a file-like object rather than a base64 string, use canvas.toBlob(callback, 'image/png'). Canvas drawing accepts sources including image elements, SVG image elements, video elements, other canvases, ImageBitmap, and OffscreenCanvas.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
VIZ-PRO Magnetic Dry Erase Board, 36 X 24 Inches, Silver Aluminium Frame
  • 【Smooth Writing and Easy to Wipe】Magnetic whiteboard, overall size: 35.4" x 23.6" ( frame included); writing surface size: 33.9" x 22.1". Smooth & durable magnetic writing surface, easily dry wipe with all dry-erase markers. Give you a very smooth writing experience.
  • 【Premium Quality】Specially lacquered surface, anti-scratch silver finished aluminium frame, ABS plastic corner with screw-fixing in corners. Fixing kits and detachable marker tray included.
  • 【Versatile Installation】Flexible mounting allows you to install your whiteboard either horizontally or vertically. Easily customize the board's orientation to fit your space and needs. The classic design will match any decoration, making it a perfect addition to your space.
  • 【Multiple Uses】It is a good choice for home, school, office, small group instruction, kitchen, stores, dormitory and classroom etc. Perfect for play counting, guided reading, learning, presentation, drawing, education and grocery list etc, without paper wasting.
  • 【Warmly Remind】If you have any questions about VIZ-PRO whiteboard, please contact us by e-mail freely, Surely help you solve the problems.

Canvas cross-origin failure

If you draw a remote image into Canvas, the canvas may become tainted unless that image is served with suitable CORS permission. Set the image element’s crossorigin attribute before assigning its source, and make sure the remote server permits the origin. Without permission, pixel access and export operations such as toDataURL() can throw a SecurityError. A placeholder drawn only from local shapes and text does not need a remote image source.

Keep meaningful text accessible

Canvas is a bitmap surface; assistive technology does not receive the individual objects or text drawn into it as semantic content. Put meaningful content in HTML and provide appropriate alternative text for images. A decorative placeholder should not substitute for the real image’s eventual alt text when that image communicates information.

Use a hosted endpoint when the URL is the interface

A URL-based service is convenient when a CMS, designer, or several applications need a consistent, parameterized image address. Open Placeholder documents a self-hostable service with dimensions up to 4000×4000, custom text, and shortcuts for common formats. Its examples include a 600×400 image, a square 256 image, and a 600×300 image with a label:

Documented shortcut dimensions include Open Graph at 1200×630, banners at 1200×400, and wide 16:9 thumbnails at 1600×900. These are useful starting points, not a requirement that every page use those sizes. Choose dimensions that match the rendered slot to avoid unnecessary image work or layout shifts.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Before depending on a hosted endpoint in production, check its cache behavior, uptime expectations, privacy implications, and rate limits for your deployment. Self-hosting the service gives you control over those operational choices. A remote endpoint also adds a request that an inline SVG data URI avoids.

Rank #3
VIZ-PRO Magnetic Dry Erase Board, 24 X 18 Inches, Silver Aluminium Frame
  • 【Smooth Writing and Easy to Wipe】Magnetic whiteboard, overall size: 24" x 18" ( frame included); writing surface size: 22" x 16". Smooth & durable magnetic writing surface, easily dry wipe with all dry-erase markers. Give you a very smooth writing experience.
  • 【Premium Quality】Specially lacquered surface, anti-scratch silver finished aluminium frame, ABS plastic corner with screw-fixing in corners. Fixing kits and detachable marker tray included.
  • 【Versatile Installation】Flexible mounting allows you to install your whiteboard either horizontally or vertically. Easily customize the board's orientation to fit your space and needs. The classic design will match any decoration, making it a perfect addition to your space.
  • 【Multiple Uses】It is a good choice for home, school, office, small group instruction, kitchen, stores, dormitory and classroom etc. Perfect for play counting, guided reading, learning, presentation, drawing, education and grocery list etc, without paper wasting.
  • 【Warmly Remind】If you have any questions about VIZ-PRO whiteboard, please contact us by e-mail freely, Surely help you solve the problems.

Use a library for predictable test fixtures

Faker’s image API offers dataUri() for a random solid-color image with text, url() for a provider image URL, and urlPicsumPhotos() for Picsum Photos URLs. For unit tests or fixtures, the local data URI is generally preferable when external availability would make the test flaky. Use provider-backed photographic content only when randomness is helpful and the provider’s availability and licensing fit the project.

For screenshot-based tests, deterministic output matters: fix the dimensions, colors, label, and any random seed or fixture data supported by your test setup. A different remote photo on each run can cause visual diffs unrelated to the code being tested.

Pass a placeholder to Next.js or Gatsby image components

Next.js

Next.js can provide blurDataURL automatically for static image imports. For a dynamic or remote image, the developer must supply blurDataURL when using placeholder="blur". Generate a small deterministic blur or SVG data URI at build time or on the server, then pass that value to the component along with the real image source. A CSS-color placeholder is another option when the desired effect is simply a neutral fill rather than a blurred preview.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Gatsby

Gatsby’s image-plugin documentation recommends inline data URIs: a placeholder that makes a network request defeats much of the purpose of having an immediate preview. Gatsby documents a 250ms fade-out when the final image loads. Treat that figure as Gatsby’s documented behavior, not a general browser timing guarantee.

Rank #4
Double-Sided White Board Dry Erase Magnetic Whiteboard Wall 24x18 Silver
  • 【Double-sided Whiteboard】- WALGLASS Whiteboard made of smooth and scratch-resistant surface, easy to write on and dry erase without stain. Double sides magnetic whiteboard design can meet all your needs to post messages and pictures on the white board with magnets.
  • 【Durable & Lightweight】: WALGLASS Magnetic white board with aluminum frame is solidly builted, portable white board is lightweight enough to be held by tacks, which can be easily hanged on the wall horizontally and vertically as you like with 4 movable hanging hooks.
  • 【Smooth Writing & Easy to Clean】: You'll love how easy it is to write on our smooth and durable writing surface, which is also easy to wipe clean with the included magnetic eraser. From making to do lists to brain storming with co-workers.it offers exceptional versatility and can be used again and again.
  • 【Multiple Uses】: Package include 4 magnetic dry erase markers (include 4 color), 8 magnets, 1 movable tray, 1 dry eraser. WALGLASS Magnetic dry erase board is a good choice for home, school, office, small group instruction, kitchen, stores, dormitory and classroom etc. Perfect for using magnets to pin notes, messages, pictures, memos, calendars and more, without paper wasting.
  • 【High Quality Assurance】: WALGLASS aims to create an emotional connection with our customers. Our after-sales team will reply to any questions about products, orders, and upgraded ideas within 24 hours. We are confident of our whiteboard and glad to talk and build a connection with our lovely customer.

Keep placeholders fast, stable, and safe

  • Match the layout slot. Reserve the final image’s aspect ratio so the placeholder does not cause content to jump when the real asset arrives.
  • Prefer inline output for tiny simple graphics. It avoids an extra request, but a large data URI can inflate HTML or application payloads; use a file or URL for substantial assets.
  • Use SVG for simple vector geometry. It scales cleanly. Use Canvas when raster composition or raster export is an actual requirement.
  • Make output deterministic in tests. Avoid changing labels, colors, or remote photographic sources between runs.
  • Bound user-controlled work. Cap dimensions and validate color and text inputs before generating output.
  • Do not place secrets in a public URL. Hosted image URLs may be visible in page markup, logs, and browser requests.
  • Separate placeholder and final-image accessibility. The placeholder must not hide or replace meaningful alternative text.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common problems

The SVG data URI appears as text or fails to render

Check that the URI begins with data:image/svg+xml,, that the SVG has the SVG namespace, and that the full SVG string is encoded with encodeURIComponent. If the markup is assigned directly to an img, do not pass raw angle brackets as though they were a URL.

Text is clipped or hard to read

Increase the canvas or SVG dimensions, lower the font size, or shorten the label. Centering with SVG’s text-anchor="middle" and dominant-baseline="middle" or Canvas’s centered alignment helps, but neither automatically wraps long text.

Canvas export throws a SecurityError

Look for cross-origin image or video content drawn onto the canvas. Configure the source with CORS support and set crossorigin before loading it, or avoid incorporating that remote content. A page’s own origin does not by itself grant permission to read pixels from another origin.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The page is slow despite using placeholders

Inspect whether each placeholder is a separate hosted request, whether data URIs have become large, and whether the page is generating unnecessarily large canvases. Use a compact SVG for a flat block, or a small Canvas output when rasterization is needed. A placeholder is not automatically a performance win if its generation and delivery cost exceed the work it replaces.

Best Value
U Brands Contempo Magnetic Small Whiteboard, 11" x 14”, White Modern Frame, Mini White Board for Students, Fridge and Locker Dry Erase Board, Includes Marker & Magnet
  • CREATE AND COLLABORATE: Enhance your workspace and set ideas free with this 11" x 14" magnetic small whiteboard with modern white frame, perfect for planning, notes, and reminders in the home, office, classroom, dorm, or workspace
  • VERSATILE AND MAGNETIC: This whiteboard is a magnet for creativity; its magnetic steel surface lets you write, erase, and display notes, photos, and reminders; perfect for students, home, office, classroom, fridge, or locker use; includes (1) dry erase marker with eraser cap and (1) white magnet
  • HASSLE-FREE MOUNTING: Effortlessly hang this board vertically or horizontally with included hassle-free strong grip mounting strips; less time spent on installation means more time to jot down notes brainstorm and showcase your creativity
  • STAIN-FREE SURFACE: Designed to resist stains and ghosting, free from messy marks or remnants of previous ideas, our premium painted steel whiteboard surface ensures a clean slate every time you write, draw, or erase; unleash your creativity without limitations
  • DESIGNED BY U: We are a company of designers, innovators, and trendsetters; a team of individuals who greatly respect the process, we remain passionate about providing well-designed products that will help you feel inspired

The preview does not appear in Next.js

For a dynamic or remote source with placeholder="blur", provide a blurDataURL; do not assume Next.js can derive one as it can for static imports. Verify the URL is a valid data URI and that the remote image’s final loading behavior is separate from the placeholder configuration.

Or skip the browser setup

ScreenshotNeo is a website screenshot API, not a placeholder-image generator. It is useful when the next task is capturing a rendered page or visual test fixture rather than drawing the placeholder itself. One GET request returns a PNG, JPEG, WebP, or PDF. Its capture process can accept cookie banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets before the shot; those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers indicate the page verdict and billing status. Its MCP server exposes screenshot tools to Claude, Cursor, and other MCP clients.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for 1,000 free screenshots a month, with no card.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Can I use a placeholder image as the final image’s alt text?

No. Provide the final image’s meaningful alternative text in HTML; a label drawn inside SVG or Canvas is not a substitute for semantic text.

Can I generate a placeholder on the server instead of in the browser?

Yes. Generate a data URI or image at build time or on the server when the result should be available before client-side JavaScript runs.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.