Search for a tool
Base64 Coding

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 -

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!

Feedback and suggestions are welcome so that dCode offers the best 'Base64 Coding' tool for free! Thank you!

Base64 Coding

Base 64 Decoder



See also: Base32

Base64 Encoder



See also: ASCII85 EncodingBase32

Answers to Questions (FAQ)

What is Base64 encoding? (Definition)

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.

How to encrypt using Base64 coding?

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 000000A16 010000Q32 100000g48 110000w
1 000001B17 010001R33 100001h49 110001x
2 000010C18 010010S34 100010i50 110010y
3 000011D19 010011T35 100011j51 110011z
4 000100E20 010100U36 100100k52 1101000
5 000101F21 010101V37 100101l53 1101011
6 000110G22 010110W38 100110m54 1101102
7 000111H23 010111X39 100111n55 1101113
8 001000I24 011000Y40 101000o56 1110004
9 001001J25 011001Z41 101001p57 1110015
10 001010K26 011010a42 101010q58 1110106
11 001011L27 011011b43 101011r59 1110117
12 001100M28 011100c44 101100s60 1111008
13 001101N29 011101d45 101101t61 1111019
14 001110O30 011110e46 101110u62 111110+
15 001111P31 011111f47 101111v63 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.

How to decrypt Base64 encoding?

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

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)

What are Base64 variants?

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

Can I use Base64 with a key?

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.

Does Base64 always end 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

What file types can Base64 encode?

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.

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.

When was Base64 invented?

RFC 2045 norm officialising Base64 is from 1996 (first version)

Source code

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.

Cite dCode

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 [online website], retrieved on 2024-06-25,

Need Help ?

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

Questions / Comments

Feedback and suggestions are welcome so that dCode offers the best 'Base64 Coding' tool for free! Thank you!
© 2024 dCode — El 'kit de herramientas' definitivo para resolver todos los juegos/acertijos/geocaching/CTF.