Base64 Encode/Decode

Base64 is an encoding scheme that converts binary data into printable ASCII characters. It is commonly used for transmitting binary data in text protocols, embedding images in HTML/CSS, and similar scenarios. This tool supports UTF-8 encoded text and Base64 conversion, effectively resolving character encoding issues. All processing is done locally.

Base64 Index Table

Base64 encoding uses 64 printable ASCII characters (A-Z, a-z, 0-9, +, /) to encode arbitrary byte sequences into ASCII strings. The "=" symbol is used for padding.

Value Char Value Char Value Char Value Char
0A16Q32g48w
1B17R33h49x
2C18S34i50y
3D19T35j51z
4E20U36k520
5F21V37l531
6G22W38m542
7H23X39n553
8I24Y40o564
9J25Z41p575
10K26a42q586
11L27b43r597
12M28c44s608
13N29d45t619
14O30e46u62+
15P31f47v63/

Base64 splits the input string into bytes, obtains the binary value for each byte (padding with zeros if less than 8 bits), concatenates these binary values, then splits them into 6-bit groups (since 2^6=64). The last group is padded with zeros if it has fewer than 6 bits. Each group is converted to decimal, and the corresponding symbol from the table above is concatenated to produce the Base64 result.

Base64 can encode any underlying binary data for use in contexts that only support ASCII character transmission. It is most commonly used for text data processing and transmission, such as in MIME-formatted email. Base64 can encode email content for reliable transmission across different language systems. Note that it is for transmission, not display—UTF-8 can display multi-byte characters on computers with the right fonts, but transmission may fail; converting to Base64 avoids this issue.

Unless otherwise specified, Base64 encoding typically uses UTF-8 for non-ASCII characters.