Wrap

Add Data URI Prefix

Paste raw Base64 and get a valid data: URI back. The MIME type is detected from the decoded bytes, and you can override it if needed.

Raw Base64 input

Data URI

About this tool

About Add Data URI Prefix

Add Data URI Prefix wraps raw Base64 into a valid data: URI, detecting the MIME type from the decoded bytes. It is for developers turning a bare payload into an embeddable data URI.

Raw Base64 is not usable as a source until it has a proper data URI wrapper. Building it locally with the right MIME type makes the payload embeddable, instantly and privately.

How to use

Step by step

  1. Paste raw Base64.
  2. The MIME type is detected from the decoded bytes.
  3. A valid data: URI is produced.
  4. Copy it for use as an image source or elsewhere.
Key features

What it offers

  • Wraps Base64 into a data URI
  • MIME detection from the bytes
  • Valid, ready-to-use output
  • Runs in the browser — Add Data URI Prefix
Common use cases

Where it helps

  • Turning a stored payload back into an embeddable data URI
  • Building a data URI to use as an image source
  • Reconstructing a URI after the prefix was stripped
  • Preparing inlined data for HTML or CSS
Best practices

Tips for best results

  • Normalise URL-safe Base64 to standard form before wrapping it.
  • Verify the detected MIME type matches the actual content.
  • Strip whitespace from the Base64 so the URI stays valid.
Common mistakes to avoid

Pitfalls to watch for

  • Wrapping Base64 that is actually URL-safe encoded without normalising it first.
  • Assuming the detected MIME is always right for ambiguous byte signatures.
  • Pasting Base64 with stray whitespace, which can produce an invalid URI.
Benefits

Why people use it

Usable output

A valid data URI you can embed.

Auto MIME

The type is detected for you.

Private

Built on your device.

Instant

Result appears immediately — Add Data URI Prefix.

FAQ

Common questions

The raw Base64 is decoded and the leading bytes are inspected against known image signatures (PNG, JPG, GIF, WebP, and more). You can also choose the type manually.
If the bytes do not match a known image signature, a sensible default is used and you can override it with the type selector.
Yes. An existing data: prefix is detected and the payload is re-wrapped with your chosen type instead of being doubled up.
No. The wrapping and detection happen entirely in your browser.
Private by design

This runs entirely in your browser

No file or text you enter here is uploaded. Encoding and decoding happen on your device using native browser APIs — close the tab and nothing remains on a server.

Install Toolisco Add it to your device for offline, one-tap access.