Daldal Tools

Image to Base64

Turn an image into a base64 data URI and copy it as CSS, HTML or Markdown, ready to paste straight into your code.

Runs in your browserFree to use

Files are processed in your browser and are never uploaded to a server.

Files are processed in your browser and are never uploaded to a server.

How to use

Free to use with no sign-up, no install and no usage limit.

Drop an image in and it comes back as a data URI, along with the snippet for whichever language you are pasting into. The CSS, HTML and Markdown forms each quote and escape the URI the way that language needs.

Embedding an image removes one network request. For a small icon on a busy page that is a real saving, since the request itself often costs more than the bytes.

Base64 grows the file by about a third, and an embedded image cannot be cached separately from the file holding it. Past roughly ten kilobytes the request you saved costs less than the weight you added, so a warning appears.

SVG is worth embedding more often than other formats, because it compresses well and is usually small to begin with.

The alt text in the HTML and Markdown snippets is taken from the file name, and a double quote in that name is escaped so the attribute does not close early.

Your image is never uploaded. It is read and encoded inside your browser.

Tools people use next