Search for a tool
Base64 Coding

Tool to decrypt/encrypt with base 64. Base64 is a coding system using 64 characters, selected to be compatible with a majority of coding tables. It is used with emails for example.


Base64 Coding -

Tag(s) : Character Encoding, Internet

dCode and more

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!

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!

Thanks to your feedback and relevant comments, dCode has developed the best 'Base64 Coding' tool, so feel free to write! Thank you!

Base64 Coding

Base 64 Decoder

See also: Base32

Base64 Encoder


See also: ASCII85 EncodingBase32

Answers to Questions (FAQ)

How to encrypt using Base64 coding

Base 64 encoding requires a binary input. For a text, the values depend on its coding (often ASCII or Unicode).

Example: To code DCODE that is written 01100100 01000011 01101111 01100100 01100101 in binary (ASCII code)

Base 64 Coding starts by splitting the binary code in groups of 6 bits, filling it with 0 if needed.

Example: Split as 011001 000100 001101 101111 011001 000110 0101 (+00)

Each group of 6 bits has a base 10 value, it corresponds to a character in the Base 64 alphabet (start at 0): ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/


Example: The conversion from 011001 to base 10 is 25 and in the alphabet 25 is Z, 000100 is 4, etc. to obtain the characters numbered 25 4 13 47 25 6 20 or the coded message: ZENvZGU

Base 64 only works with groups of 4 characters, if needed, fill with =.

Example: Finally ZENvZGU (that had 7 chars) becomes ZENvZGU= (8 chars, a multiple of 4) which is the final base64 encoded message.

How to decrypt Base64 coding

Decryption consists in finding back values of the letters in the Base64 alphabet: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ (equal sign = is ignored)

Example: A coded message is YjY0, corresponding values of Y,j,Y,0 in the alphabet are: 24,35,24,52

Values are converted to 6-bit binary.

Example: 24 is converted 011000, 35 = 100011, etc. the decoded binary message is 011000100011011000110100

Base64 decoding is then complete. Binary message is then read using the desired coding system (ASCII, Unicode, etc.)

Example: In ASCII, 01100010,00110110,00110100 corresponds to the plain text b,6,4

How to recognize a Base64 ciphertext?

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.)

Why using Base64?

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)

Does Base64 always ends with ==?

No, as indicated in the encoding principle, the presence of characters = (equal) is not mandatory, it occurs approximately 3 times out of 4.

Why is data size increasing?

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

Why is Base64 named like this?

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.

What is Base64URL?

Base64URL is a variant of Base64 suitable for URLs (http). Characters 62 + and 63 / can cause problems with URL, they can be replaced by respectively - and _. Furthermore, the equal = sign is deleted.

When Base64 was invented?

RFC 2045 norm officialising Base64 is from 1996

Source code

dCode retains ownership of the online "Base64 Coding" source code. Except explicit open source licence (indicated CC / Creative Commons / free), the "Base64 Coding" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, 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, copy-paste, or API access for "Base64 Coding" are not public, same for offline use on PC, tablet, iPhone or Android ! Remainder : dCode is free to use.

Need Help ?

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!

Questions / Comments

Thanks to your feedback and relevant comments, dCode has developed the best 'Base64 Coding' tool, so feel free to write! Thank you!

Source :
© 2021 dCode — The ultimate 'toolkit' to solve every games / riddles / geocaching / CTF.