BASE64 Converter

This tool allows you to convert string expression to base64.

BASE64 Encoding

Base64 converter allows converting binary data to text. So you can transmit or store binary data. 64 different numbers expressed with 6 bits are matched with 64 different characters expressed as Printable Characters. In cases where the number of bytes in the data to be base64 encoded is not a multiple of 3, the data is padded until the number of bytes in the data is a multiple of 3, and the parts that are not in the original data are indicated by = in the output. Due to padding, data encoded with Base64 often ends up with = or ==. Here the question may come to mind why padding is needed. It can be argued that padding is not really needed in cases where the data size is also known to the party decoding the Base64. This observation is actually true, but Padding is used to make the technique work universally in all cases. For example, if Base64 is used in a streaming application (data size cannot be known instantaneously), Padding will be needed. The main usage area of ​​Base64 encryption is to transmit binary data with protocols such as mail, HTTP, FTP, which are designed to transmit text and are not binary compatible. The reason why binary data cannot be transmitted with these protocols is the risk of passing special characters such as CRLF, which are considered special by these protocols, in binary data. For example, CRLF - Carriage Return / Line Feed will be detected as Line Ending by the HTTP client or server. With Base64 Encoding, it is guaranteed that there will be no special characters in the data. It is seen that 1 byte is spent for every 3 bytes encoded with Base64 encoding, and the data size increases by approximately 1/3. This rate will negatively affect data transfer performance, but unfortunately there is not much that can be done about it. Another usage area of ​​Base64 Encoding is adding images and other files to HTML and CSS documents by encoding with Base64 using Data URLs format in modern browsers. For example: "< img src="data:image/jpeg:base64,a2ossA== />" In Linux-like systems, the inputs given using the base64 program can be subjected to Base64 Encode and Base64 Decode operations. One of the most common uses of Base64 is encoding data that is intended to be stored in text format instead of binary for various reasons. Binary Hash value resulting from MD5 or SHA1 can be effectively Base64 encoded. We have MD5 hash converter.


Finally, the binary value resulting from MD5 or SHA1 can be divided into two parts of 4 bits per byte and converted to text with the hex equivalents of these parts inefficiently. Since each byte is converted to two bytes here, the loss will be more than Base64.