Base64 Decode

Paste a Base64-encoded string and convert it back to plain text instantly. Handles both standard and URL-safe Base64 automatically. 100% client-side — nothing is sent to any server.

Base64
Plain text

Related Tools

Frequently Asked Questions

How do I decode Base64 in JavaScript, Python, and the terminal?

JavaScript (browser): atob('encodedString') returns the decoded string. For Unicode output: decodeURIComponent(escape(atob('encodedString'))). In Node.js: Buffer.from('encodedString', 'base64').toString('utf8').

Python: import base64; base64.b64decode('encodedString').decode('utf-8')

Terminal (macOS): echo 'encodedString' | base64 -d Terminal (Linux): echo 'encodedString' | base64 --decode Terminal (Windows PowerShell): [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('encodedString'))

Why does my Base64 string have = at the end?

Base64 encodes 3 bytes into 4 characters. When the input length is not a multiple of 3, padding characters (=) are appended to make the output length a multiple of 4.

One = means 1 byte of padding (input length was 2 mod 3). Two == means 2 bytes of padding (input length was 1 mod 3). You will never see three = signs.

In URL-safe Base64 (Base64url, used in JWTs), padding is often omitted entirely. Our decoder handles both padded and unpadded strings automatically.

What does 'Invalid Base64' mean?

An invalid Base64 error means the string cannot be decoded. Common causes:

1. Wrong character set: standard Base64 uses +/ while URL-safe Base64 uses -_. Mixing them causes errors. 2. Missing or incorrect padding: the string length must be a multiple of 4 (or padding must be correctly omitted). 3. Corrupted string: extra characters, spaces, or line breaks introduced during copy-paste. 4. Not actually Base64: the string may be hex-encoded, percent-encoded, or another format entirely.

Our tool auto-detects URL-safe vs standard Base64 and handles missing padding.

Can I decode a Base64 image back to a file?

Yes. Base64-encoded images typically appear as data URLs: data:image/png;base64,iVBORw0K.... Strip the data:...;base64, prefix to get the raw Base64 string, then decode it.

In JavaScript: const blob = await fetch(dataUrl).then(r => r.blob()); — the browser handles stripping the prefix automatically when you fetch a data URL. Alternatively: const bytes = Uint8Array.from(atob(base64str), c => c.charCodeAt(0)); const blob = new Blob([bytes], { type: 'image/png' });

Our tool's decoded output can be downloaded as a file for binary content.