XhCode Online Converter Tools
50%

Base64 Decode


Enter the text to Base64 Decode

Size : 0 , 0 Characters

The Base64 Decode:

Size : 0 , 0 Characters
Base64 Decode

Base64 decoding is the process of reversing the Base64 encoding to retrieve the original binary data. It converts a Base64-encoded string (such as aGVsbG8=) back into the original data (like the string "hello").

How Base64 Decoding Works:
Input Base64 String: You start with the Base64-encoded string, which may include padding (=) if necessary.
Map Each Base64 Character Back to 6 Bits: Each Base64 character corresponds to a 6-bit group in the binary data.
Reassemble the Binary Data: Convert the 6-bit groups back into the original binary form.
Convert Back to Original Format: Finally, the binary data is converted into the original format (e.g., text, image, or file).
Example of Base64 Decoding:
Let's decode a simple Base64 string: "aGVsbG8="

Base64 Alphabet:

ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
Map each Base64 character to its corresponding 6-bit value:

a → 0
G → 6
V → 21
s → 44
b → 1
G → 6
8 → 60
Combine the 6-bit values:
000000 000110 010110 111000 011000 000101 100000 001100

Reconstruct the original 8-bit data (bytes): 01101000 01100101 01101100 01101100 01101111

Convert to Characters:

01101000 → "h"
01100101 → "e"
01101100 → "l"
01101100 → "l"
01101111 → "o"
Decoded Output: The decoded string is "hello".

Why Base64 Decoding is Used:
Retrieving Original Data: When you receive a Base64-encoded string, decoding restores the original data, which could be text, images, or files.
Data Transmission: Base64 is commonly used in data transmission, like encoding images in HTML, email attachments, or web APIs.