Base64 is a method to convert binary data into a string of ASCII characters for storage and transmission in environments designed to handle text rather than binary data. Each base64 character represents exactly 6 bits of data. The string length must be a multiple of 4 (which might require padding).