Encoding converters
Base64 to Data URL
Convert Base64 to a data URL online: automatic MIME detection, correct data: URI syntax for HTML, CSS and JavaScript, plus copy-as-CSS and copy-as-HTML snippets. 100% client-side.
Build a data URL from Base64 — the ready-to-paste form used in <img> tags, CSS backgrounds and email templates. The MIME type is detected from the actual bytes (not guessed), and one click switches between the raw URI, HTML and CSS forms.
How to use
Base64 to Data URL, step by step
- 01
Paste the Base64 of any file — image, font, audio, PDF. The MIME type is detected from the decoded bytes and shown in the result card.
- 02
Pick an output form: the plain data:… URL, an <img src="…"> snippet, or a CSS background-image rule.
- 03
Copy the result with one click and paste it straight into your HTML, CSS or template.
FAQ
Frequently asked questions
A data URL embeds a file’s bytes directly in a URL: data:<mime>;base64,<payload>. Browsers treat it as the file itself — no separate request, no hosting. It is the standard way to inline small images, fonts and icons in single-file HTML documents.
For small, cache-unfriendly or self-contained assets: email templates (where external images are often blocked), single-file reports and demos, icon sprites, and cutting one HTTP request from a critical page. For large assets, a real file with caching wins.
Modern browsers accept data URLs into the megabytes for CSS and HTML use, but performance suffers long before the hard limits — decode cost and DOM size grow with the payload. A common rule of thumb is to stay under ~2 KB for HTML attributes and under ~100 KB for CSS assets.
Because it is detected from the bytes, not from the file name or your guess. An .svg file that is actually PNG, or a .jpg that is really a WebP, gets its true type — which is exactly what you want in a data URL, since browsers trust the declared MIME.
Yes, the Data URL to Base64 tool does that: it parses the URI, verifies the payload and returns canonical Base64 plus a preview.
The generated background-image: url("data:…") rule is standard CSS 2.1+ and works everywhere, including email clients that support background images at all.
Related tools