- Scan QR code
- UTF-16LE
- UTF-32LE
- US-ASCII
- ISO-8859-1 (Latin-1)
- ISO-8859-15 (Latin-9)
- Windows-1252
- ISO-8859-2 (Latin-2)
- Windows-1250
- ISO-8859-3 (Latin-3)
- ISO-8859-4 (Latin-4)
- ISO-8859-13 (Latin-7)
- Windows-1257
- Shift_JIS
- EUC-JP
- ISO-2022-JP (JIS)
- GB2312 (EUC-CN)
- GB18030
- Big5-HKSCS
- EUC-KR (KS X 1001)
- ISO-2022-KR
- ISO-8859-5
- Windows-1251
- KOI8-R
- KOI8-U
- ISO-8859-6
- Windows-1256
- ISO-8859-7
- Windows-1253
- ISO-8859-8
- Windows-1255
- ISO-8859-9 (Latin-5)
- Windows-1254
- TIS-620
- Windows-874
- Windows-1258
Decoded
Base64 |
---|
Encoded
Base64 |
Line Break
|
---|
About Base64
Base64 is an encoding method that uses 7-bit printable ASCII characters. Mainly used in email to transfer 8-bit data over a 7-bit data path.
In Base64, data is divided into 6 bits and converted into alphanumeric characters (A-Z, a-z, 0-9) and symbols (+, /). Converts every 4 characters, and if the last is less than 4 characters, pad with the equal symbol (=).
In addition, RFC 1421 (PEM: Privacy-Enhanced Mail) stipulates line breaks every 64 characters, and RFC 2045 (MIME) stipulates line breaks every 76 characters.
The conversion table for Base64 characters is as follows.
6-bit data | Base64 character |
---|---|
000000 | A |
000001 | B |
000010 | C |
000011 | D |
000100 | E |
000101 | F |
000110 | G |
000111 | H |
001000 | I |
001001 | J |
001010 | K |
001011 | L |
001100 | M |
001101 | N |
001110 | O |
001111 | P |
010000 | Q |
010001 | R |
010010 | S |
010011 | T |
010100 | U |
010101 | V |
010110 | W |
010111 | X |
011000 | Y |
011001 | Z |
011010 | a |
011011 | b |
011100 | c |
011101 | d |
011110 | e |
011111 | f |
100000 | g |
100001 | h |
100010 | i |
100011 | j |
100100 | k |
100101 | l |
100110 | m |
100111 | n |
101000 | o |
101001 | p |
101010 | q |
101011 | r |
101100 | s |
101101 | t |
101110 | u |
101111 | v |
110000 | w |
110001 | x |
110010 | y |
110011 | z |
110100 | 0 |
110101 | 1 |
110110 | 2 |
110111 | 3 |
111000 | 4 |
111001 | 5 |
111010 | 6 |
111011 | 7 |
111100 | 8 |
111101 | 9 |
111110 | + |
111111 | / |
For example, if you convert "Hello" with Base64, it will be as follows.
1. Make it a binary representation.
01001000 01100101 01101100 01101100 01101111 (For US-ASCII / UTF-8)
2. Separate every 6 bits. If it is less than 6 bits, pad it with "0" at the end.
010010 000110 010101 101100 011011 000110 111100
3. Convert to characters using a conversion table. Convert every 4 characters, and if it is less than 4 characters, pad the end with "=".
SGVs bG8=
4. Connect all the characters to get the Base64 conversion result.
SGVsbG8=
Email MIME message header type (RFC 2047)
DenCode also supports decoding of MIME message header format (RFC 2047), such as below. This format is used when the subject, recipient, etc. of the email contains non-ASCII characters.
Subject: =?UTF-8?B?44K144Oz44OX44Or?=
The result after decoding is as follows.
Subject: サンプル