Base64 Encode/Decode (Text)

Loading dropzoneโ€ฆ

Input

Output

About this Base64 decoder Online Base64 Decoder

Part of the Encode64 โ€œBase64 Studioโ€, this decoder turns Base64 strings, data URIs and email attachments back into their original text or binary data in a few clicks. Paste, drop a file, decode โ€” nothing is uploaded to a server.

Why Use This Base64 Decoder

  • Real-time decoding preview for text-based payloads
  • Support for multi-line Base64 blocks, PEM-style sections and data URIs
  • URL-safe Base64 support (-/_ variants) with automatic normalization
  • Friendly for email attachments and MIME blocks (Content-Transfer-Encoding: base64)
  • Handles binary payloads โ€” download the decoded result as a file
  • Mobile-friendly interface for quick checks on the go
  • Decoding happens in your browser โ€” Base64 content is not sent to a remote server

๐Ÿ”ง How Base64 Decoding Works (Step-by-Step) for base64-decoder

1

Paste or drop Base64 data

Paste your Base64 string into the input area, or drop a text file containing Base64 data. The tool can also detect and extract the payload from data:*;base64,... URLs.

2

Normalize and validate

The decoder trims whitespace, handles URL-safe characters (- and _), and checks that the string only uses valid Base64 characters plus optional padding =.

3

Decode Base64 blocks

Every 4 Base64 characters are mapped to 24 bits, regrouped into 3 original 8-bit bytes. Padding = tells the decoder how many bytes are in the final group.

4

Preview or download the result

If the decoded output is text, you see it directly in the output panel. For binary data (images, documents, archives, etc.), you can download the decoded result as a file.

Technical Specifications

Character Set & Variants

The decoder follows RFC 4648 for standard Base64 and also understands the URL-safe variant.

Range / TypeCharactersNotes
Indices 0โ€“25Aโ€“ZUppercase letters
Indices 26โ€“51aโ€“zLowercase letters
Indices 52โ€“610โ€“9Digits
Indices 62โ€“63+ /Standard Base64 symbols
Padding=Signals that the last quantum is incomplete
URL-safe- _Common web-safe variant (re-mapped to + / before decoding)

Size Relationship (Original vs Base64)

Base64 encoding increases size by roughly one third. When you decode, the data shrinks back to its original size.

Original sizeBase64 size (approx.)Overhead
3 bytes4 characters~33% larger
1 KBโ‰ˆ 1.37 KB~37% larger including padding and newlines
1 MBโ‰ˆ 1.37 MBSame ratio at larger scales
If your decoded data is not significantly smaller than the Base64 input, it might include additional headers or wrapper text.

Performance & Practical Limits

Base64 decoding is lightweight, but browser memory still matters for very large payloads.

Payload sizeUser experienceRecommendation
A few KBInstantPerfect for quick copies from DevTools or logs
100 KB โ€“ 1 MBStill very responsiveTypical for API responses or small attachments
1โ€“5 MBGenerally fine on modern machinesUse downloads for binary data
> 5โ€“10 MBMay feel slow or memory-heavy in the browserPrefer CLI or language libraries

Command-Line Base64 Decoding

For very large files or automated pipelines, use native Base64 tools in your environment.

Linux / ๐Ÿ macOS

Decode a Base64 string

echo 'SGVsbG8=' | base64 --decode

Decodes the inline string SGVsbG8= into Hello.

Decode a Base64 file

base64 -d input.b64 > output.bin

Converts a Base64 file back to raw binary data.

Windows / PowerShell

Decode with PowerShell

[Text.Encoding]::UTF8.GetString([Convert]::FromBase64String("SGVsbG8="))

Decodes a Base64 string into UTF-8 text.

Decode with certutil (CMD)

certutil -decode input.b64 output.bin

Uses built-in Windows tooling to decode a Base64 file.

Practical Applications

Web Development & APIs

Inspect and recover data from Base64 payloads in the browser.

  • Decode images embedded as data URIs in HTML / CSS.
  • Inspect Base64-encoded payloads in REST or GraphQL responses.
  • Decode Base64 blobs stored in LocalStorage or IndexedDB.
const binary = atob(base64String);
const json = JSON.parse(atob(encodedJson));

Email & MIME Attachments

Work with Base64-encoded attachments and MIME parts.

  • Decode Base64-encoded email attachments from EML files.
  • Inspect MIME parts with Content-Transfer-Encoding: base64.
  • Debug mailer libraries that embed inline images.
Content-Transfer-Encoding: base64
const buffer = Buffer.from(encodedContent, 'base64');

Security & Forensics

Understand what is actually hidden behind Base64 blobs.

  • Decode suspicious Base64 blobs found in logs or payloads.
  • Inspect obfuscated configuration values or script fragments.
  • Combine with other tools to understand encoded IoCs.
// Node.js example: decode suspected payload
const decoded = Buffer.from(encoded, 'base64').toString('utf8');
console.log(decoded);

โ“ Frequently Asked Questions

โ“Why does my decoded output look corrupted?

The most common causes are: (1) the Base64 string contains invalid characters, (2) the padding = characters are missing or truncated, (3) the original data was binary (image, PDF, ZIP, etc.) but you are trying to view it as plain text. In that last case, download the decoded result as a file instead of displaying it directly.

๐Ÿ”—How do I handle URL-safe Base64?

URL-safe Base64 replaces '+' with '-' and '/' with '_', and sometimes omits padding '='. This tool automatically normalizes those characters during decoding. If you implement it yourself, replace '-' โ†’ '+', '_' โ†’ '/', then pad with '=' until the length is a multiple of 4.

๐Ÿ”’Is Base64 a secure way to hide data?

No. Base64 is an encoding, not encryption. It is reversible by design and provides no confidentiality. If the decoded payload contains sensitive information, make sure proper encryption (for example AES or TLS in transit) is used in your system.

๐Ÿ“What is the maximum size I can safely decode here?

The tool is comfortable with Base64 blocks up to a few megabytes in most modern browsers. Larger payloads may work but can become slow or memory-intensive. For anything beyond ~5โ€“10 MB, itโ€™s better to use command-line tools or server-side libraries.

Pro Tips

Best Practice

If decoding fails, first strip out any headers (such as '-----BEGIN' / 'END-----' blocks) and retry with only the Base64 characters.

Best Practice

When you expect JSON, wrap the decode step in a try/catch with JSON.parse to fail fast if the payload is not what it claims to be.

Performance Tip

For large binary payloads (images, archives), decode them directly to a file instead of trying to display them as text.

Additional Resources

Other Tools