Base64 Decoder

Search...

⌘K

Base64 Decoder

Search...

⌘K


Base64 Decoder

Base64 Decoder

Decode Base64 strings effortlessly with our Base64 Decoder. Perfect for reversing Base64-encoded data from APIs, email attachments, or browser storage. Need to encode instead? Try our Base64 Encoder. For decoding encoded URLs, use the URL Decoder, and for text decoding, the UTF8 Decoder is your go-to.

Test your APIs today!

Write in plain English — Qodex turns it into secure, ready-to-run tests.

Regular Expression - Documentation

What is Base64 Decoding?


Base64 decoding is the process of reversing Base64 encoding. Base64 is not encryption—it’s a binary-to-text encoding scheme used to represent binary data (like images, files, or Unicode strings) in an ASCII string format. Decoding converts this encoded string back to its original binary or plain text format.


How Base64 Decoding Works


Base64 encoding divides input data into 6-bit chunks and maps each chunk to a printable character using the Base64 index table. Decoding reverses this:


  1. Identify valid Base64 characters: These include uppercase (A–Z), lowercase (a–z), numbers (0–9), +, and /.

  2. Convert characters to binary: Each Base64 character maps to a 6-bit binary number.

  3. Reconstruct original bytes: Group every 4 characters (24 bits) into 3 bytes (8 bits each).

  4. Handle padding (=): Padding indicates missing data in the last chunk and is safely removed during decoding.


How to Decode Base64 in Practice


Here’s an example using JavaScript:

const encoded = "SGVsbG8gV29ybGQ=";
const decoded = atob(encoded);
console.log(decoded); // Output: Hello World


And in Python:

import base64
encoded = "SGVsbG8gV29ybGQ="
decoded = base64.b64decode(encoded).decode('utf-8')
print(decoded)  # Output: Hello World

These methods decode the Base64 string "SGVsbG8gV29ybGQ=" back to "Hello World".


Use Cases of Base64 Decoding


  • Email Attachments: MIME encodes attachments in Base64.

  • API Payloads: Transmitting images, JSON, or files over text-based protocols.

  • Data Storage: Safely storing binary data in text files or databases.

  • Debugging: Inspecting JWT tokens or encoded config values.


Pro Tips


  • Use a UTF-8 decoder after decoding if you’re working with special characters.

  • Don’t confuse Base64 with encryption—it’s reversible and offers no security.

  • Ensure your Base64 string is clean—spaces or invalid characters will cause decoding errors.


Frequently asked questions

What is Base64 decoding used for?×
Base64 decoding is used to convert Base64-encoded data (like email attachments, API payloads, or embedded files) back to its original readable or binary form.
Is Base64 decoding the same as decrypting?+
Why does my Base64 string have = at the end?+
Can Base64 decode special characters like emojis or non-English text?+
What happens if I try to decode an invalid Base64 string?+