Binary File to Base64 Encoder / Translator

Use this tool to create data streams for embedding images (or any type of file) in (X)HTML, CSS and XML.

URI:

(X)HTML Image Embedding Example

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA..." alt="Embedded Image" />

CSS Image Embedding Example

div.image {
  width:100px;
  height:100px;
  background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA...);
}

XML Image Embedding Example

<image>
  <title>An Image</title>
  <link>http://www.your.domain</link>
  <url>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA...</url>
</image>

Don't stop there!

Data URIs can potentially store any type of data, not just images! Try these examples on for size:

(X)HTML CSS Embedding Example

<link rel="stylesheet" type="text/css" href="data:text/css;base64,LyogKioqKiogVGVtcGxhdGUgKioq..." />

(X)HTML Javascript Embedding Example

<script type="text/javascript" href="data:text/javascript;base64,dmFyIHNjT2JqMSA9IG5ldyBzY3Jv..."></script>
By GreyWyvern
Document version: 1.3 - December 21, 2007