Image to Base64 / Data URI

Drop an image and copy it as a data URI, CSS background, HTML tag or Markdown.
Back to Tools

About this base64 converter

Drag an image in and get its data URI immediately, along with the four forms you actually paste somewhere: a CSS background-image rule, an HTML <img> tag, Markdown image syntax, and the raw base64 payload without the data: prefix. The panel also reports the image's pixel dimensions, MIME type, original size and encoded size.

That last number is the one worth watching: base64 inflates a file by roughly 33%, and an inlined image cannot be cached separately by the browser or served by a CDN. Inlining is a good fit for small icons, sprites, email signatures and single-file HTML demos; past about 20 KB the tool warns you, and past 100 KB it recommends a normal image file instead. Everything runs client-side — the image is read with the FileReader API and never uploaded. Related tool: Base64 & JWT Decoder.