Image to Base64 Converter

Turn pictures into text for HTML and CSS, and back.

About Base64 images

A Base64 image is the picture written as text, so it can sit inside HTML, CSS or JSON without a separate file. It is about a third bigger than the file, so it suits small icons and logos best.

Converted in your browser. Your image is not uploaded.
Guide

How to convert an image to Base64

1

Add your image

Drop a PNG, JPG, WebP, GIF, SVG or ICO.

2

Copy what you need

Get the data link, the Base64 only, an HTML tag or a CSS rule.

3

Or go the other way

Switch to Base64 to image, paste the text and download the picture.

Frequently asked questions

Is my file uploaded?

No. It is processed in your browser, so the file stays on your device.

Why is the Base64 bigger?

Base64 turns every 3 bytes into 4 characters, so it is about a third larger than the file.

When should I use it?

For small icons and logos placed directly in HTML, CSS or JSON. Large pictures are better as normal files.

What is a data link?

A web address that holds the picture itself, starting with data:image/.

Related tools

See all image tools →