Skip to main content
All tools








data:

File to inline data URI

Convert a file into an inline data URI such as data:image/gif;base64,Zm9vYmFy...

About this tool

This tool is used to convert a file into a URI, which can then be embedded directly into HTML, CSS, JavaScript or elsewhere.

Entire files can be represented as a URI using the data: protocol, specifying the data type, and encoding the raw data in base64.

Example

If we take this image:



We can embed it directly into HTML by converting it into a data URI, and using it as the source for an image:
        <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUBAMAAAB/pwA+AAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAABJQTFRF/86mAAAAfWVSyp14iWhNSTYmcl9n8AAAAElJREFUeJxjZIADRtKYgu8ZwAQqU+keA5ggwgRm3QtAGkgyMrD4rwUyTbkPAEX97l9gYBaSBooymN4BijqtBWszuctgtJc0RwIAiScRFVSWnwYAAAAASUVORK5CYII=" />
      
Read more