Encoding Options

Online Base64 Encode

Online Free Base64 encode tool. Our simple base64 encode tool will help you quickly encode string to base64.Tool uses UTF-8 as the default encoding.Our tool output is aligned with the Base64 Data Encodings specification (RFC 4648).

How does Base64 encoding work?

  • Dividing:Base64 encoding operates on 8-bit units, so the binary data is divided into groups of three bytes (24 bits).
  • Converting: Converting the three bytes into a 24-bit binary number. Each group of three bytes is combined into a 24-bit binary number.
  • Splitting: Splitting the 24-bit binary number into four 6-bit units.The 24-bit binary number is split into four 6-bit units. These 6-bit units form the indices for selecting characters from the Base64 character set.
  • Mapping: Each 6-bit unit is treated as an index value, and the corresponding character from the Base64 character set is selected. The Base64 character set consists of 64 characters, typically comprising uppercase letters (A-Z), lowercase letters (a-z), numbers (0-9), and two additional characters, such as '+' and '/'. These characters are used to represent the binary data.

The following table shows the mapping from binary data to Base64 characters:

Byte Base64 Character
0000 A
0001 B
0010 C
0011 D
0100 E
0101 F
0110 G
0111 H
1000 I
1001 J
1010 K
1011 L
1100 M
1101 N
1110 O
1111 P

Some additional details about Base64 encoding:

  • Base64 encoding increases the size of the data by 33%. This is because each group of 3 bytes is converted into 4 characters of text.
  • Base64 encoding is not secure.

Why Base64 Encode?

  • To attach binary data to an email message.
  • To embed binary data in a web page or other text-based document.
  • Data storage in text-based formats: To store binary data in a configuration file.
  • Data transmission: To transmit binary data over a network that only supports ASCII characters.
  • Encryption and hashing: To obfuscate binary data, such as passwords or API keys.
  • To store binary data in a database that only supports text fields..
  • To transfer binary data over a protocol that only supports text, such as HTTP.

Configuration Options

  • Character set:: Tool use UTF-8 as default character set.
  • Encode Each Line Separately: Tailor the conversion to your requirements with adjustable options.
  • Split lines: Newline characters are converted to their Base64-encoded forms. Use this option if you want to encode multiple independent data entries separated with line breaks.
  • Free & Easy to Use: The encoded data will become a continuous text without any whitespaces, so check this option if you want to break it up into multiple lines. The applied character limit is defined in the MIME (RFC 2045) specification, which states that the encoded lines must be no more than 76 characters long.