Binary-to-Text Encoder:

Select any file (text, image, audio ...):

Text Encoding Output (0 characters):

Binary-to-Text Decoder:

Text Encoding Input:

How does it work?

Binary-to-text encodings are a way to express arbitrary binary data as printable text. This is done by translating the value of bit groups into an ASCII or Unicode character. The most used text encoding is Base64, which uses 64 printable ASCII characters. As 64 is less than 256 (i.e. the number of values a byte can represent), Base64 outputs a string containing more characters than input bytes (more specifically, 4 characters per 3 bytes). The main advantage of Base64 is that every character is generally encoded by 1 byte, thus limiting the difference between the binary size of the output text and the input. A slightly better alternative is Base85, as this encodes 5 characters per 4 bytes.

Base256, Base1024 and Base65536 output strings that contain the same amount or fewer characters than the amount of input bytes. For example, Base65536 needs N/2 characters to express N bytes. However, this comes at a cost: using UTF-8, most of the characters used by these encodings are encoded by more than 1 byte (up to 4 bytes), which means the binary size of the output text can be quite a bit larger than the binary size of the input.

One interesting note: Twitter has a character limit of 280, but considers some Unicode characters to be of length 1. All characters used for the Base1024 encoding are such characters. This means that by using this encoding, more than 280 bytes (i.e. 350 bytes) can be effectively encoded inside the text of a tweet!