Input

Output

Base64 Decoding Examples

Base64 strings are decoded back to their original form. Example:

Decoding text

Base64 input:

Input

Decoded output:

Output

Paste the Base64 into the editor above. Use Sample to load more.

What Is Base64 Decoding?

Base64 decoding reverses the encoding process: it converts a Base64 string back into its original binary or text form. The RFC 4648 specification defines the alphabet and padding rules. Decoding is needed when you receive Base64-encoded data from APIs, email attachments, or embedded images and need to extract the original content.

This tool uses the browser's built-in atob() function for decoding. Processing runs entirely in your browser—nothing is sent to a server. You can paste a Base64 string or upload a file containing Base64. For encoding text or files to Base64, use the Base64 Encoder.

How to Use This Tool

1

Paste or Upload

Paste your Base64 string into the left editor or click Upload to load a file. The tool accepts raw Base64, Data URIs (e.g., data:image/png;base64,...), or files with Base64 content. Use Sample to load example data.

2

Check the Output

The right panel shows the decoded result. For text, it displays the original string. For binary data (images, PDFs), use Download to save the file. Invalid Base64 (wrong characters, bad padding) will show an error. For Base64 image strings, use Base64 to Image to preview the image directly.

3

Copy or Download

Use Copy for text output or Download to save binary data as a file. The download format is inferred from the data when possible. For encoding text or files to Base64, use the Base64 Encoder.

How Base64 Decoding Works

Base64 uses 64 characters to represent 6 bits each. Decoding takes 4 Base64 characters (24 bits) and outputs 3 bytes of binary data. Padding characters (=) are stripped before decoding. The atob() function in browsers performs this conversion. Data URIs like data:image/png;base64,iVBORw0KGgo... are automatically detected—the tool extracts and decodes the Base64 portion after the comma.

When the decoded data is an image (PNG, JPEG, GIF, WebP), you can preview it using the Base64 to Image tool, which displays the image and lets you download it. For creating Base64 from images (e.g., for embedding in HTML), use Image to Base64.

Where Base64 Decoding Helps

API responses often return Base64-encoded images or file content. Decoding here lets you save the file or inspect the raw data. Email clients decode MIME attachments from Base64. When debugging, you might find Base64 strings in logs, configs, or JSON payloads—pasting them here reveals the original content. For JSON that contains Base64 image fields, decode the value and use Base64 to Image to view it.

Database exports sometimes store binary data as Base64. Decoding lets you recover the original files. If you need to encode data instead, use the Base64 Encoder. For XML or JSON that embeds Base64, decode the relevant fields and process them separately.

Frequently Asked Questions

Is my data private?

Yes. Decoding runs entirely in your browser. No data is sent to any server. You can confirm this by opening your browser's Network tab while using the tool.

What if I get "Invalid character" or "Invalid Base64"?

Base64 only allows A–Z, a–z, 0–9, +, /, and = (for padding). Spaces, newlines, or other characters cause errors. Remove them or use a string that contains only valid Base64. Data URIs are supported—paste the full data:...;base64,... string and the tool will extract the Base64 part.

Can I decode images?

Yes. Paste a Base64 image string (or Data URI) and use Download to save the image file. For a visual preview without downloading, use the Base64 to Image tool, which displays the image in the browser.

What's the size limit?

Large Base64 strings (e.g., 10+ MB) may slow down the browser. The tool has a 10 MB limit for file uploads. For very large data, consider a command-line tool like GNU base64.

Does it support Base64url?

Base64url uses - and _ instead of + and /. Some implementations require converting these before decoding. If you get errors with Base64url strings, try replacing - with + and _ with / first. See RFC 4648 Section 5.

Related Tools

For the formal specification, see RFC 4648. MDN's atob documentation covers browser decoding. btoa() is used for encoding in JavaScript.