Base64 Decoder


What is Base64 decoder online

Base64 decoder online is a free tool to decode Base64 strings to plain text.

What is Base64?

Base64 is a group of binary-to-text encoding schemes that represent binary data (more specifically, a sequence of 8-bit bytes) in an ASCII string format by translating the data into a radix-64 representation. The term Base64 originates from a specific MIME content transfer encoding. Each non-final Base64 digit represents exactly 6 bits of data. Three bytes (i.e., a total of 24 bits) can therefore be represented by four 6-bit Base64 digits.

Example

Base64 encoded text:
dGVzdCBzdHJpbmc=
Original text:
test string

Different ways to decode Base64

This section contains examples of how to decode Base64 strings in different environments.

Shell

echo dGVzdCBzdHJpbmc= | base64 -d

JS/JavaScript

const decodedData = atob('dGVzdCBzdHJpbmc=');
console.log(decodedData); // 'test string'

Python

import base64

base64_string ="dGVzdCBzdHJpbmc="
base64_bytes = base64_string.encode("ascii")
sample_string_bytes = base64.b64decode(base64_bytes)
sample_string = sample_string_bytes.decode("ascii")

print(sample_string) // 'test string'