Base64 Encoder & Decoder

Encode text to Base64.

Base64 SGVsbG8=

Formula: Groups of 3 bytes become 4 Base64 characters

Step-by-step with your numbers:
1. Values used:
2.
3. Base64 = SGVsbG8=
Did we solve your problem today?

Base64 encodes binary or text data using 64 safe characters.

How the Math Works

Base64 encoding transforms binary data into ASCII characters by grouping input bytes into chunks of 3 bytes (24 bits total). These 24 bits are split into four 6-bit segments, each mapped to a unique character from a 64-character alphabet (A-Z, a-z, 0-9, +, /). This mathematical rearrangement ensures compatibility with text-based systems, as each encoded character represents 6 bits of the original data. Padding characters (=) are added if the input length isn't divisible by 3 to maintain consistent output length.

Practical Applications

To encode text, input your data into the calculator and click 'Encode'—the result is a Base64 string suitable for embedding in HTML, JSON, or XML. For decoding, paste the Base64 string into the tool and click 'Decode' to retrieve the original text. This is essential for transmitting binary data (like images or files) through systems that only handle ASCII text, such as email or APIs. Developers also use it for securely storing sensitive data in configuration files or databases.

Day-to-Day Use

Base64 helps everyday tasks like sharing images in email without corruption, embedding logos directly in web pages, or encoding data for QR codes. It's used in password managers to store encrypted keys, in social media platforms to share binary files as text, and in cloud services to transfer data between systems. Even when you scan a document and save it as a Base64 string in a text file, this encoding ensures the data remains intact and usable across different applications.

Worked example

Hello becomes SGVsbG8=.

FAQ

Why use Base64?

To send binary data safely through text-only channels like email or URLs.