This is a Base64 online encoder. Use this tool to convert data to the Base64 format.
Base64-Encode.Online is a free web application for converting data to Base64 format. In accordance with UNIX philosophy, this online tool is designed to do one thing only and do it well - encode data to Base64.
Currently, this tool can be used to encode to Base64 textual data only, but in the nearest future it could be used to encode binary files (images, PDF documents, etc.) as well.
How it works
Basically, the Base64 encoding is the process of encoding the binary data into a "printable" ASCII character set. The textual data firstly should be converted into the binary format.
The encoder converts the textual data into the binary using the Python's string.encode()
method. Then it encodes this binary data to Base64 using the base64.standard_b64encode()
. Finally it decodes the Base64 binary string back to the textual format using the base64_bytes.decode()
method and displays the result in the text area above.
Advanced options
string.encode()
method. By default, Base64-Encode.Online uses the UTF-8 character set. If you want to convert the input textual data to another character set before encoding it to Base64, you can change the character set using this option. The data encoded to Base64 doesn't contain information about the character set, so to decode it from Base64 you may have to specify the character set selected during encoding.
Guaranteed security
All communications with Base64-Encode.Online are secured with SSL protocol (HTTPS). Both your browser and our servers encrypt all traffic before sending any data. We do not store or inspect the contents of the entered data or uploaded files in any way.
Completely free
You don’t have to pay anything. All the features of this web application are accessible free of charge.
The Base64 encoding is the process of encoding binary data into a "readable" string. It allows to encode arbitrary bytes to bytes which are known to be safe to send without getting corrupted. Thanks to it, you can convert Chinese characters, emoji and even images and PDF documents into a "readable" string, which can be saved or transferred anywhere.
The Base64 encoding is commonly used when there is a need to store or transmit the binary data over systems that are designed to deal with ASCII, e.g. email via MIME. The Base64 alphabet consists of the ASCII alphanumeric character set and a couple of symbols.
The Base64 encoding process
The Base64 encoding scheme is described in RFC 3548. The Base64 encoding takes the original binary data and devides it into chunks of 3 bytes. A byte consists of 8 bits, so Base64 takes 24 bits in total. These 3 bytes are then converted into 4 "printable" ASCII characters from the table above.
The disadvantage is that the message encodeed using the Base64 algorithm increases its length - every 3 bytes of data are encoded to 4 ASCII characters (a ~33% increase).
Example
The Base64-encoded value of "Harry Potter" is SGFycnkgUG90dGVy.
Source | Text (ASCII) | H | a | r | r | y | <space> | P | o | t | t | e | r | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Octets | 72 | 97 | 114 | 114 | 121 | 32 | 80 | 111 | 116 | 116 | 101 | 114 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Bits | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | |
Base64 encoded | Index | 18 | 6 | 5 | 50 | 28 | 39 | 36 | 32 | 20 | 6 | 61 | 50 | 29 | 6 | 21 | 50 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Character | S | G | F | y | c | n | k | g | U | G | 9 | 0 | d | G | V | y |
Encoded in ASCII, the characters H
, a
, r
, r
, y
, <space>
, P
, o
, t
, t
, e
, r
are stored as the decimal values: 72
, 97
, 114
, 114
, 121
, 32
, 80
, 111
, 116
, 116
, 101
, 114
.
These ASCII values can be represented in 8-bit binary as follows:
01001000 01100001 01110010 01110010 01111001 00100000 01010000 01101111 01110100 01110100 01100101 01110010
Joined together, they constitute a binary stream of:
010010000110000101110010011100100111100100100000010100000110111101110100011101000110010101110010
.
The Base64 encoding starts from chunking this binary stream into groupings of six characters:
010010 000110 000101 110010 011100 100111 100100 100000 010100 000110 111101 110100 011101 000110 010101 110010
Each of these groupings translates into the numbers: 18
, 6
, 5
, 50
, 28
, 39
, 36
, 32
, 20
, 6
, 61
, 50
, 29
, 6
, 21
50
.
Finally, these numbers can be converted into the ASCII characters using the Base64 encoding table: S
, G
, F
, y
, c
, n
, k
, g
, U
, G
, 9
, 0
, d
, G
, V
, y
.