SVG Placeholder Generator

Web

Generate SVG placeholder images as data URLs with custom size, colours and text. Mock up layouts and prototypes before real assets are ready. Save as a file.

Configure
SVGPreview · 640×360
640×360
SVG codeSource
<svg xmlns="http://www.w3.org/2000/svg" width="640" height="360" viewBox="0 0 640 360">
  <rect width="640" height="360" fill="#0d9488"/>
  <text x="50%" y="50%" font-family="-apple-system,system-ui,sans-serif" font-size="45" font-weight="600" fill="#ffffff" text-anchor="middle" dominant-baseline="central">640×360</text>
</svg>

About SVG Placeholder Generator

During layout work the real images often are not ready yet, so you need a precisely-sized placeholder that can label its own resolution. This tool builds SVG placeholders locally in your browser: set the width, height, background color, text color, and caption, and it assembles vector SVG code you can inline into HTML or turn into a Data URI. Being vector, it stays sharp at any scale, and being tiny, it saves more bandwidth than bitmap placeholders. Dimensional accuracy is the core value of such an asset and the easiest thing to get wrong. A placeholder exists to hold and label the real layout size, so its width and height must match the final asset; a different size means every layout decision made with it shifts on replacement. Confirm the dimensions come from the design file rather than being typed in. Against a plain colour block or border, an annotated placeholder wins on communication: size and copy are visible in the image so review need not cross-check a document. The cost is that it reads as unfinished once live, so manage it as a development artefact and replace it before release, with the replacement on the release checklist rather than in someone memory. Being vector brings two more properties: tiny size and lossless scaling, which suit slow networks and mobile debugging. Note that it stays sharp only in vector form, so a screenshot or bitmap export blurs when enlarged, which is why documents and design files should reference the original vector. The annotation content needs agreement too. A placeholder reading "banner" tells a reviewer the purpose, while "headline, about twelve characters" lets wrapping and truncation be verified during layout. It costs almost nothing extra and moves that verification one stage earlier. Finally, choose a tone clearly unlike the real design, such as light grey with dark grey text, so nobody mistakes it for the final visual, while keeping enough contrast that the annotation stays legible in a projector or a screenshot. Against a pure-style placeholder, a standalone file has clear boundaries. Drawing a sized block in a stylesheet is lighter during development, needing no extra request and no file to manage, but when the placeholder must state dimensions and copy, or be handed to designers and colleagues, a file explains itself without the other party reading your stylesheet. Files for collaboration, styles for solo debugging. Accessibility labelling applies here too. When a placeholder carries explanatory text, give the graphic an accessible name or title so a screen reader announces a sized placeholder rather than skipping it as decorative. This is easily missed on temporary pages that use placeholders, yet it decides whether the page reads correctly in accessibility tooling during review.

How It Works Internally

The placeholder is vector and described geometrically, so it scales without blur and is usually only a few hundred bytes. The trade-off is that it is a placeholder: once live it reads as unfinished content, so replace it before release, and mark it in the stylesheet when it must stay so all instances can be found and swapped.

InputAn 800×600 placeholder
OutputA few hundred bytes and sharp at any scale, but visibly unfinished when public, so replace it before release

Measured on This Page

Fixed: unescaped labelThe label was interpolated straight into <text>, so "A & B <x>" produced A & B <x> and the bare & / < made the whole document invalid XML — the downloaded .svg would not open and the data URL would not render. Five characters are now XML-escaped
Fixed: dimensions unvalidatedA width or height of 0 or a negative number produced width="0" (invisible) or worse; values are now clamped to integers between 1 and 10000
Parses after escapingText containing & < " ' and Chinese still parses as XML, with content matching the input
Font size and centringSize is min(w,h)/8 with text-anchor=middle and dominant-baseline=central; a label approaching the canvas width overflows because there is no auto-shrink (documented in the note)

SVG is XML, not HTML: a bare & or < that HTML tolerates makes an SVG document fail to parse outright. That missing escape was this page's defect — type 'A & B' and you get a file that will not open, while the on-page preview may still look fine. Dimension validation came along with it: 0, negatives and absurd values all produced unusable files. Two usage reminders: a label close to the canvas width overflows, since the font size is fixed at one eighth of the short edge with no auto-shrink; and placeholders should be replaced before launch, because both users and crawlers read a placeholder as an unfinished page.

How this was measured: Four label types (plain, containing & and <, containing double quotes, Chinese) were typed in, the generated SVG text read back and validated with an XML parser; width/height of 0 and a negative value were also checked. Measured before and after the fix. · Measured 2026-10-31

How to Use

  1. Open "SVG Placeholder Generator"
  2. Pick a preset size or type your own width and height
  3. Set background, text color and the label
  4. Watch the preview update and the SVG source rebuild
  5. Click "⬇ SVG" to download, or copy the markup for inlining

Use Cases

  • Layout blocking — Drop exactly-sized placeholder blocks into cards, carousels, or grids to tune a responsive layout first.
  • Lazy-load base — Provide a lightweight SVG first paint for lazy-loaded images to stop layout shift before they arrive.
  • Design annotation — Print dimensions like 800x600 right on the placeholder to align slice specs with designers.
  • Offline ready — Replace placeholder links that depend on a third-party domain so intranet or offline pages still render.
  • Inline Data URI — Convert the placeholder to a Data URI inside an img or CSS to save one HTTP request.
  • Storybook dummy — Generate placeholder SVGs for component stories so every story renders without missing-image icons.
  • Responsive test grid — Create placeholders at multiple aspect ratios to verify a CSS grid layout across viewports.

FAQ

Why SVG instead of a PNG placeholder?

SVG is vector, staying crisp and undistorted at any size, and a few hundred bytes of code can describe a whole image — far smaller than an equivalent PNG, which is ideal for placeholders.

How do I use the generated SVG on a page?

Three ways: inline the SVG code directly in HTML, save it as a .svg file referenced by an img, or convert it to a Data URI used in src or a CSS background.

Does the caption text scale automatically?

Font size can be set relative to the width and height and centered with text-anchor. If your container is responsive, give the SVG a width of 100% so it scales proportionally.

Can I batch-generate several sizes?

Generate them one size at a time, commonly for multi-resolution placeholders in a responsive srcset. For random colored blocks, change the background color and generate again.

Does SVG in a Data URI need escaping?

Yes. When placed directly in CSS, characters like # must be URL-encoded, or wrap it in base64, or some browsers fail to parse it. This tool outputs a ready-to-use form.

Can the placeholder ship on a production page?

Acceptable briefly, not long term. It is built from text and blocks, precisely sized and instantly loaded, which suits the layout phase, but once live it reads as unfinished content to visitors and crawlers. Use it in development and staging and replace it before release; if a placeholder must stay, mark it in the stylesheet so all instances can be found and swapped.

Why does the placeholder stay sharp when enlarged?

Because it is vector, described geometrically rather than as a pixel grid, so it is recalculated when scaled and shows no mosaic. That holds only in vector form: converted to a bitmap and then enlarged, it blurs like anything else. Keep the vector source when scaling is needed and export a bitmap only where vector formats genuinely are not supported.

The generated placeholder ignores my colour inside <img>?

An SVG referenced via data URI with a hard-coded fill cannot be overridden by external CSS. Generate the colour as a parameter, or use currentColor to inherit text colour. Inlining the <svg> markup directly gives you full CSS control.