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 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.
Step by step
- Paste raw Base64.
- The MIME type is detected from the decoded bytes.
- A valid data: URI is produced.
- Copy it for use as an image source or elsewhere.
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
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
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.
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.
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.
Common questions
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.