Image to Base64 Converter

Your files never leave your browser — everything runs on your device.

Choose an image Click here or drag & drop your image onto this box.

Images over 5 MB are not accepted — base64 text is about a third larger than the file, so big images make very long strings.

Turn any image into a base64 string you can paste straight into HTML or CSS — handy for embedding a small icon or logo without a separate image file. Upload the image and copy the data URL. Everything runs in your browser, so the image stays on your device.

Frequently asked questions

What is base64 encoding?

Base64 turns the bytes of a file into plain text made of letters, digits, + and /. That text can be embedded in HTML, CSS or JSON where a binary file cannot go.

Why is the base64 string longer than the image?

Base64 stores 3 bytes as 4 characters, so the text is about 33% larger than the original file. It is best for small images like icons and logos.

How do I use the result in HTML?

Paste the whole data URL into an image tag, like <img src="data:image/png;base64,...">. The browser then shows the image without loading a file.

Is my image uploaded to a server?

No. The encoding runs entirely in your browser on your device.