Base64 Decode Online

Decode and encode Base64 strings with a single click. All client-side.

Paste a Base64 string in the input box and click Base64 Decode to convert it back to plain text. Click Base64 Encode to go the other direction. All processing runs locally in your browser — no data is sent to any server.

What is Base64 decoding?

Base64 decoding is the inverse of encoding: it converts Base64-encoded text (using the 64-character alphabet A–Z a–z 0–9 + /) back into its original binary or text form. Every 4 Base64 characters decode back to 3 original bytes.

The decoded output may be plain text, an image, a PDF, or any other binary data — depending on what was originally encoded.

Common sources of Base64 data

JWT tokens
The header and payload of a JWT are Base64url-encoded JSON objects. Replace - with + and _ with / before decoding, or use the JWT Decoder.
Email MIME parts
Email attachments use Base64 to transport binary data through 7-bit SMTP servers. Raw email source shows Content-Transfer-Encoding: base64 followed by the encoded data.
Data URLs
HTML data URIs (data:image/png;base64,...) embed files inline. Strip the data:...;base64, prefix before decoding the payload.
API responses
REST and GraphQL APIs sometimes return binary fields (certificates, keys, images) as Base64 strings inside JSON responses.

Code examples

JavaScript (browser / Node.js)
// Decode Base64 to string
const decoded = atob('SGVsbG8sIFdvcmxkIQ==');  // "Hello, World!"

// Decode to Uint8Array (for binary data)
const binary = atob('SGVsbG8=');
const bytes  = Uint8Array.from(binary, c => c.charCodeAt(0));

// Decode Base64url (JWT segments — replace URL-safe chars first)
function decodeB64url(str) {
  str = str.replace(/-/g, '+').replace(/_/g, '/');
  while (str.length % 4) str += '=';
  return JSON.parse(atob(str));
}
Python
import base64

# Decode Base64 to string
data = base64.b64decode('SGVsbG8sIFdvcmxkIQ==')
text = data.decode('utf-8')  # "Hello, World!"

# Decode URL-safe Base64 (from JWTs)
data = base64.urlsafe_b64decode('SGVsbG8' + '==')  # add padding as needed

Frequently asked questions

My decoded output looks like garbled characters — why?
The original data was binary (an image, compressed file, etc.), not UTF-8 text. Base64 decoding always succeeds; the result simply cannot be displayed as readable text if the source was binary.
I get an "Invalid character" error — what does that mean?
The input contains characters outside the Base64 alphabet (A–Z, a–z, 0–9, +, /, =). Check for line breaks, spaces, or URL-safe characters (- and _) that need to be converted first.
How do I handle Base64url (from JWTs)?
Replace - with + and _ with /, then add = padding until the string length is a multiple of 4, then decode as standard Base64. Or use the JWT Decoder for structured output.
Is Base64 decoding the same as decryption?
No. Base64 is a reversible encoding with no key. Anyone with the encoded string can decode it trivially. It provides no confidentiality.

Related tools