tooldura

All tools

Image to Base64

Convert an image to Base64, a data URI, or a ready CSS/HTML snippet

About Image to Base64

The Image to Base64 tool turns a picture into text you can paste straight into code: a raw Base64 string, a full data URI, or a CSS background-image and an HTML img tag with the encoding already inside them. Base64 has no way to shrink the picture, only to re-spell every three bytes as four printable characters, so the output is always about a third larger than the file you dropped in — a real cost worth seeing before you commit an image this way to a stylesheet. The other direction works too: paste a Base64 string or a data URI back in, and it renders as an actual image, with its real format identified from the bytes themselves when nothing declared it, ready to download as a file again.

FreeNo paywalls or tiers
No SignupNothing to create
InstantNo setup, no install
Any DeviceMobile, tablet, desktop

The guide behind this tool

Base64 Images: The 33% Overhead Explained, and When It's Worth It

A base64 image is a third larger than the file, never cached on its own, and often silently dropped by the email client you were embedding it for.

7 min read

How to use Image to Base64

  1. 1

    Drop an image onto the box, or click it to pick one.

  2. 2

    Read the size line: original bytes versus the Base64 that came out, and by how much it grew.

  3. 3

    Copy whichever form you need — plain Base64, a data URI, a CSS rule, or an HTML tag — each with its own button.

  4. 4

    Switch to Base64 → Image to go the other way: paste a string or a data URI.

  5. 5

    Check the preview and the detected format, then download it as a file if that is what you needed.

Frequently Asked Questions

Because Base64 was built to carry binary data through text-only channels, not to compress anything. It reads three bytes at a time and writes four ASCII characters for them, so the output is always 4/3 the input before padding, which works out to about 33% larger. There is no setting that avoids this: it is what encoding binary data as text costs.