Skip to content
faker.tools
All 79

Plate V · Media, Image & Asset Placeholders

Base64 Image Data URI Generator

Self-contained images with no network request, sized as you like.

text
data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMjAiIGhlaWdodD0iMjAwIiB2aWV3Qm94PSIwIDAgMzIwIDIwMCI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0iIzJjMmZlMiIvPjx0ZXh0IHg9IjUwJSIgeT0iNTAlIiBmaWxsPSIjZmZmZmZmIiBmb250LWZhbWlseT0ibW9ub3NwYWNlIiBmb250LXNpemU9IjI5IiB0ZXh0LWFuY2hvcj0ibWlkZGxlIiBkb21pbmFudC1iYXNlbGluZT0ibWlkZGxlIj4zMjDDlzIwMDwvdGV4dD48L3N2Zz4=
/* 376 base64 characters, roughly 0.3 KB decoded */
2 lines · 454 BGenerated in your browser · Base64 Image Data URI Generator

A data URI is an image with no request attached. It works in an email, in a sandboxed iframe, in a test that must not touch the network — and the 1×1 transparent pixel remains the smallest useful image on the web at 43 bytes encoded.

What you can control

  • Five content types, including the classic 1×1 transparent pixel for spacers and tracking stubs.
  • Four wrappers: bare data URI, raw base64, an <img> tag, or a CSS background-image rule.
  • The encoded size is reported so you can see when the base64 overhead stops being worth it.
  • Labelled placeholders print their own dimensions, which makes a broken layout obvious at a glance.

What this is not

Base64 inflates a file by roughly 33% and the result cannot be cached separately from the document that contains it. Above about 10 KB, a real image file is the better choice.

Questions

When is a data URI worth it?

Below roughly 10 KB, where saving an HTTP round trip beats the 33% size penalty. Above that, use a real file so the browser can cache it independently.

Do these work in email?

SVG data URIs are blocked by most email clients. For email, use a PNG or GIF data URI — the 1×1 pixel option is a GIF for exactly that reason.

Why does the SVG option produce such small files?

SVG is text, and a solid rectangle is a few dozen characters. A PNG of the same rectangle carries a header and compression tables it does not need.

Next in Media

All 8