Tool to decrypt/encrypt with base 64 (or Base64), an encoding system with 64 characters, selected to be compatible with a majority of coding tables.
Base64 Coding - dCode
Tag(s) : Character Encoding, Internet
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
Base64 is a computer code using 64 characters to encode any binary string with text (it is notably used for emails). It uses 64 characters to represent data, hence the name.
Base 64 encoding requires binary input/data (for text, binary values depend on the encoding used, often ASCII or Unicode).
Example: Code DCODE which is written 01100100 01000011 01101111 01100100 01100101 in binary (ASCII code)
Base64 encryption begins by splitting the message into groups of 6 bits, supplemented with 0 if necessary.
Example: Cutting/separating gives 011001 000100 001101 101111 011001 000110 0101 (+00)
Each 6-bit group is then converted into a character from a predefined 64-character alphabet/array: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
0 000000 | A | 16 010000 | Q | 32 100000 | g | 48 110000 | w |
---|---|---|---|---|---|---|---|
1 000001 | B | 17 010001 | R | 33 100001 | h | 49 110001 | x |
2 000010 | C | 18 010010 | S | 34 100010 | i | 50 110010 | y |
3 000011 | D | 19 010011 | T | 35 100011 | j | 51 110011 | z |
4 000100 | E | 20 010100 | U | 36 100100 | k | 52 110100 | 0 |
5 000101 | F | 21 010101 | V | 37 100101 | l | 53 110101 | 1 |
6 000110 | G | 22 010110 | W | 38 100110 | m | 54 110110 | 2 |
7 000111 | H | 23 010111 | X | 39 100111 | n | 55 110111 | 3 |
8 001000 | I | 24 011000 | Y | 40 101000 | o | 56 111000 | 4 |
9 001001 | J | 25 011001 | Z | 41 101001 | p | 57 111001 | 5 |
10 001010 | K | 26 011010 | a | 42 101010 | q | 58 111010 | 6 |
11 001011 | L | 27 011011 | b | 43 101011 | r | 59 111011 | 7 |
12 001100 | M | 28 011100 | c | 44 101100 | s | 60 111100 | 8 |
13 001101 | N | 29 011101 | d | 45 101101 | t | 61 111101 | 9 |
14 001110 | O | 30 011110 | e | 46 101110 | u | 62 111110 | + |
15 001111 | P | 31 011111 | f | 47 101111 | v | 63 111111 | / |
Example: The first code 011001 corresponds to Z, 000100 corresponds to E, etc. or the coded message: ZENvZGU
Base 64 is standardized to have groups of 4 characters, if necessary, complete with the filler character =.
Example: ZENvZGU (which has 7 characters) becomes ZENvZGU=' (8 characters, a multiple of 4) which is the final message encoded in base64.
To decode Base64 data, reverse the encoding process: convert each character to its 6-bit binary equivalent, then recombine these groups to find the original binary data.
Any equal signs = do not exist in the alphabet and are ignored.
Example: A message has been encoded YjY0, the codes of Y,j,Y,0 in the alphabet are respectively 011000,100011,011000,110100 which represents the decoded binary message 011000100011011000110100
Base64 decoding is then completed. If the binary message was a character string, it is then read according to the original encoding (ASCII, Unicode, etc.)
Example: In ASCII: 01100010,00110110,00110100 corresponds to the 3 characters b64
The message is theoretically composed of a number of characters multiple of 4. To this end, the presence of characters = (equal) at the end of the message is a big clue.
The message has a maximum of 65 distinct characters (and possibly space or line break). By default it is: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
Base64 is typically used in emails for non-ASCII messages and attachments (via the MIME standard: Multipurpose Internet Mail Extensions)
The Usenet network used Base64 to transfer files, any indication referring to it is a clue.
Several signatures of users or sites are associated with Base64 as code 6.0 (94/25) or the .b64 extensions
Base64 is sometimes used to store passwords that cannot be encrypted, in order to prevent them from being displayed in plain text, as in the XML configuration files of certain software (Databases, FTP, Filezilla, etc.)
A Base64 encoded message will only contain printable ASCII characters ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
This property allows transmitting any data on systems originally designed to transmit only text (without having to worry about the initial encoding or how the characters will appear on the screen of the recipient of the message)
Base64 is a standard (RFC 4648) but several variants have been proposed, some officially, others are proposals that are little or not used.
— Base64URL is an official variant of Base64 suitable for URLs (http). The characters 62 + and 63 / can cause problems in URLs, so replace them with - and _ respectively. In addition, the = is often ignored/deleted.
— Base64 (RFC 2045) for MIME (Multipurpose Internet Mail Extensions), this old version specifies that Base64 encoded lines are limited to 76 characters.
— itoa64, an integer to string conversion function that uses the alphabet ./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
— y64, a variant for URL proposed by Yahoo, + becomes ., / becomes _ and = becomes -
— Radix-64, a recognized standard (RFC 4880) offering as alphabet 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/
— uuencoding, a Unix encoding using the first 64 printable characters of the ASCII table (a variant replaces the space with `)
— xxencoding, a rare encoding using +-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
— BinHex 4.0, an Apple algorithm that uses a special alphabet !"#$%&()*+,-012345689@ABCDEFGHIJKLMNPQRSTUVXYZ[abcdefhijklmpqr`
— megan35, atom128, zong22, hazz15 are web inventions offering seemingly random substitution alphabets
Base64 is a coding system, not an encryption system. It is not intended to be used with a key and there is no variation using Base64 with a key.
However it is possible to encrypt a message by first using encryption with a key before encoding the result with Base64.
Some modern ciphers, such as AES or RSA, return binary data and it is common to use Base64 to share an encrypted message.
Also, a private/secret key for encryption (or a public key) can be shared via Base64 encoding if necessary.
No, as indicated in the encoding principle, the presence of characters = (equal) is not mandatory, it occurs approximately 3 times out of 4.
In Base64, 4 ASCII characters are used to code 3 bytes. Volume is increased by 33%.
Example: Base64 (6 characters) is coded QmFzZTY0 (8 characters or +33%)
base64 (no uppercase) is coded YmFzZTY0
All files are supported, the usual file formats
— Audio: WAV, MP3, WMA, FLAC, etc.
— Image: JPG, PNG, WEBP, GIF, etc.
— Documents: PDF, DOC, DOCX, ODT, TXT, etc.
— Video: AVI, MKV, MP4, etc.
This list is not exhaustive, all file types are compatible with Base64 encoding.
The base64 uses a sixty-four character alphabet to code any binary string (in base 2), so it is a mathematical conversion to base 64.
RFC 2045 norm officialising Base64 is from 1996 (first version)
dCode retains ownership of the "Base64 Coding" source code. Except explicit open source licence (indicated Creative Commons / free), the "Base64 Coding" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or the "Base64 Coding" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "Base64 Coding" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!
Reminder : dCode is free to use.
The copy-paste of the page "Base64 Coding" or any of its results, is allowed (even for commercial purposes) as long as you credit dCode!
Exporting results as a .csv or .txt file is free by clicking on the export icon
Cite as source (bibliography):
Base64 Coding on dCode.fr [online website], retrieved on 2024-12-21,