Image to Base64

Turn a picture into its Base64 text form — the string used to embed images directly inside HTML, CSS, or data files.

Tap to choose an image — or drag it here
Any image type the browser can read.

About this tool

Base64 encodes binary data as printable text; browsers accept it inline wherever an image URL fits, using the data: prefix followed by the image type. The trade-off is size: Base64 text is about a third larger than the original file, so it suits small images — icons, logos, email graphics — rather than photographs. Conversion here is done by the browser's own file reader, locally.

Common questions

How is the output used in HTML? Paste it as the src of an img tag, keeping the data: prefix on: the browser renders the text itself as the picture, with no separate file to host.

Why is the string so long? Every 3 bytes of image become 4 characters of text, and photos hold a lot of bytes. A 300 KB photo produces roughly 400 KB of text.

Private by design: this tool runs entirely in your browser. Nothing typed, pasted, or opened here is uploaded, stored, or tracked.