Base64 to Image Decoder

  • Please provide Number Of Words.

Ops! Invalid Data.

About this tool:

The tool decodes the Base64 encoded string into an image. It allows you to decode Base64 as an image and preview it directly in the browser.

What do you mean by encoding?

Encoding is the process of converting a piece of information or instruction into a particular form.

Suppose you have three applications, X, Y, and Z.

  • An application X is using A encoding scheme. More specifically, using the UTF-8 encoding scheme, that can encode up to 2,164,864 characters.
  • An application Y uses a B encoding scheme, a subset of the A encoding scheme. More specifically, using the ASCII encoding scheme, that can encode up to 128 characters.
  • An application Z is using the same encoding scheme as application A. Means using the UTF-8 encoding scheme.

If you have to send the data from application X to application Z, the best solution is to send it from X to Z directly. Because if you involve application Y in the process, there is a high chance of data loss. Because application Y uses the encoding scheme, that is a subset of an application's A encoding scheme. Therefore, it will not be able to interpret the data correctly.

There is another encoding scheme called Base 64 Encode.

What is Base64 encoding, and how does Base64 encryption works?

Base64 is a Binary to ASCII encoding scheme. That encoding scheme transfers the binary data over the medium supporting textual data transfer, but not binary data transfer. For example, when embedding an image into HTML, CSS file, or database.

A Base64 encoded string looks like this aHR0cHM6Ly9pcGxvY2F0aW9uLmlvL2Jhc2U2NC10by1pbWFnZQ==

Base64 encoding scheme uses the same 64 characters that are present in almost all encoding schemes. Therefore, when you use Base64 encoding, there is less chance of data loss, and you are much certain that your data will reach the final destination without interruption. As these 64 characters are present in almost all encoding schemes, so these are not controlled characters. These characters are

  • Upper case alphabets A-Z.
  • Lower case alphabets a-z.
  • Number characters 0–9.
  • Characters + and /.
  • The character = is used for padding.

Now the next question is, how Base64 encryption works?

Bytes formed the data, are broken down into 24 bits. These three bytes (24 bits) are further broken down into four packs of six bits each. These six bits form a number corresponding to the index in the character set supported by the Base64 encoding scheme.

What if the number of characters to be encoded does not come with a multiple of six bits?

  • Suppose if the remainder is 18, we add an "=" to the encoded string. That means the encoded string is 6 bits short.
  • Suppose if the remainder is 12, we add "==" to the encoded string. That means the encoded string is 12 bits short.
  • Suppose if the remainder is 6, we do not add anything to the encoded string. However, that means the encoded string is 18 bits short.

How to decode an image from Base64 Encoded string by using an online Base64 to Image Converter?

To decode an image from the Base64 Encoded string, perform the following steps.

  • Open the Base64 to Image Converter.
  • Enter a Base64 Encoded string.
  • Select the Image type. The default one is PNG format. However, you can also select between JPG, ICO, GIF, BMP, Webp, and SVG from the dropdown.
  • After selecting the Image type, click on the "Generate Image" button.
  • The tool decodes the Base64 Encoded string and displays the image.
  • Click on the "Download Image" button to download that generated image.
  • Base64 to Image Converter works well on Windows, MAC, Linux, Chrome, Firefox, Edge, and Safari.

Note: You can also click on the "Load Sample Data" button. To upload sample data, and can check the tool's functioning.