Base 64 Decoder


Use this online free Base64 Decoder tool to decode any Base64 encoded data back to binary data. Just type or past any Base64 encoded data in the input textarea above, and the tool will decode the input.

Base64 is an encoding algorithm that allows converting any characters into an alphabet which consists of Latin letters, digits, plus, and slash. Due to this algorithm, even Chinese characters, emojis, and images can be converted into a “readable” string.

In computer science, Base64 is a group of binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation. The term Base64 originates from a specific MIME content transfer encoding. Each Base64 digit represents exactly 6 bits of data. Three 8-bit bytes (i.e., a total of 24 bits) can, therefore, be represented by four 6-bit Base64 digits.

Common to all binary-to-text encoding schemes, Base64 is designed to carry data stored in binary formats across channels that only reliably support text content. Base64 is particularly prevalent on the World Wide Web where its uses include the ability to embed image files or other binary assets inside textual assets such as HTML and CSS files. (Wikipedia)

The set of 64 characters represent the 64 place-values for the base varies between implementations. The general strategy is to choose 64 characters that are common to most encodings and that are also printable. This combination leaves the data unlikely to be modified in transit through information systems, such as email, that were traditionally not 8-bit clean. For example, MIME's Base64 implementation uses A–Z, a–z, and 0–9 for the first 62 values. Other variations share this property but differ in the symbols chosen for the last two values; an example is UTF-7.

Initially, the algorithm was named “printable encoding” and only in June 1992, RFC 1341 defines it as “Base64”. The 64 characters represent the 64 place-values for the base varies between implementations.

The history of the Base64 algorithm started when, in the past, engineers argued over how many bits should be in a byte. Some decades ago, seven-bit, six-bit, and three-bit bytes were used. But when the eight-bit byte approved as standard many systems used old standards and did not support the new one. Some problems will occur. For example, a mail server may discard the eighth bit when sending emails or they could only send text, but not images, videos, archives, etc.. So a new algorithm was developed to solve this problem - Base64.

Base64 is most commonly used to encode binary data such as images, or sound files to embed into HTML, CSS, EML, and other text documents. In addition, Base64 is used to encode data that may be unsupported or damaged during transfer, storage, or output.

Base64 Decoder Tool will help you convert any Base64 encoded data to binary text.

Since text-based systems like email interpret binary data as a wide range of characters, as well as special command characters, much of the binary data that is transmitted to transfer media is misinterpreted by those systems and lost in the transmission process.

One method of encoding this kind of binary data in a way that avoids such transmission problems is to send it as plain ASCII text in Base64 encoded format. This is one of the techniques employed by the MIME standard to send data other than plain text.

Base64 Decoding Logic

Decoding Base64 with padding

Decoding Base64 text, four characters are converted to three bytes. But when padding characters exist the logic changes. A single = indicates that the four characters will decode to only two bytes, but == indicates that the four characters will decode to only a single byte.

Decoding Base64 without padding

After decoding of four characters to three bytes without padding, four encoded characters may remain. In this case, only two or three characters will remain. A single remaining encoded character is not possible because a single Base64 character contains 6 bits, and 8 bits are required to create a byte, so a minimum of 2 Base64 characters are required. The first character contributes 6 bits, and the second character contributes its first 2 bits.