Base64 encoder/decoder online

Encoding/decoding

Encodes and decodes base64 data streams (by upload or direct input).

This online tool encodes binary data into a base64 string or decodes a base64 string into the binary representation. You can enter data to be encoded/decoded by uploading a file or directly into the textarea below. Encoded base64 data can be split in lines each 76 chars long.
Implementation uses PHP's base64 functions which in turn comply to the RFC 2045 standard. 

Max size of the input data is 10 MiB.

clear
clear
clear

Wrappers are executed in sequence on shared data string. For example, to supply base64-encoded stream of GZIP-compressed data enter wrappers: base64, gzip and fill the data input with the base64 stream. 

If data is not entered information from other tabs (upload, by URL and direct) is used to replace data on this page. This lets you enter gzip as a wrapper here and upload a file using upload tab while leaving data on this page empty. 

Currently supported wrappers are: base64, bzip, cslashes, datauri, direct, ftp, ftps, gzip, hex2bin, http, https, qprintable, upload, url, urlencoding, zlib

  • Upload
  • By URL
  • Direct input
  • Custom
Ctrl+Shift+E ↔

Base64 is a commonly used method for representing datastream that may contain bytes with any values into a stream of bytes that look like Latin characters (a-z), digits (0-9) and 3 special characters (/ + =).
Base64 is mostly used to convert binary data into text representation which can be safely transmitted over the network through services which might damage it in its raw form. For example, early e-mail applications attempted to convert incoming messages into receiver's character set which would most probably corrupt binary. 

Иase64 algorithm is actually simple to understand: input stream is processed in 3-byte chunks, each chunk (8 * 3 = 24 bits) is divided into 4 smaller «bytes» (6 bits in each). Then since max possible value for a 6-bit number is 64 we only need 64 symbols to represent it. This is what base64 (and its other variations) do: each value from 0 to 63 is assigned a symbol (in this order: A-Z, a-z, 0-9, +, /) and then output.
This way output stream is always ~33% larger than the original (4 / 3 ~1.33)

Besides base64 there are other encodings used for similar purpose – like uuencode (originating from an Unix mail client) or URL encoding (also called percent-encoding, generally very inefficient).
However, base64 is generall a best choice and is widely used. 

There also are variations of base64 itself: 

Apart from these there are near a dozen of base64 standards for different environments (for example, in XML or OpenPGP) – you can see the list at this Wikipedia article.
The tool on this page uses PHP's base64 functions which in turn comply to the RFC 2045 standard.