CompleteSEOTools
Home › Image & Design Tools › Image to Base64 Converter

Image to Base64 converter

Convert a picture into a Base64 string you can paste into HTML or CSS, or turn a string back into a picture.

About Image to Base64 Converter

Base64 writes the bytes of a file using only letters, digits and a few symbols, so the picture can sit inside a web page or a style sheet as plain text. Pick a file and you get four ready-made forms: the full data URI, an img tag, a CSS background rule and the bare Base64. The decode tab does the reverse and shows the picture. The file is read in your browser and is never uploaded.

  • Embedding a small icon in an HTML email or a single-file page.
  • Putting a tiny image straight into a CSS rule to save a request.
  • Checking what a Base64 string in a log or an API reply actually contains.
  • Saving a picture that arrived as Base64 text.

How to use Image to Base64 Converter

1

Step 1

On the Encode tab, choose a picture. Files up to 10 MB are accepted.

2

Step 2

Copy the form you need: data URI, img tag, CSS or raw Base64.

3

Step 3

To go back, open the Decode tab, paste the string and press Decode.

Good to know

  • Base64 makes the data about a third larger than the file. It suits small images, not photographs.
  • A string that does not start with data: is checked by its first bytes, so the picture type is guessed from the content.
  • Browsers cap very long URLs in some places. If a long data URI misbehaves, link to the file instead.

Common questions

Is my picture uploaded?

No. The file is read by your browser and the text is built on your device.

Why is the Base64 bigger than the file?

Every three bytes become four characters, so the text is roughly 33 percent larger.

Which formats can I decode?

Any picture format your browser can show, such as PNG, JPEG, GIF, WebP and SVG, as long as the string is valid Base64.