Base64 decoder

5 of 1 ratings

Decode Base64 online back to its original text or binary file. This Base64 decoder reverses Base64-encoded strings—perfect for Base64 to text converter, Base64 to file (PNG, PDF, ZIP), decode Base64 image from a data URL, and URL-safe Base64 decoding. If you’ve searched for “decode Base64 string online” or “Base64 to binary converter”, you’re in the right place.

What is Base64 decoding?

Base64 decoding converts a Base64-encoded string (ASCII-safe text) back into the original bytes. Base64 maps every 3 bytes into 4 characters using a 64-symbol alphabet plus optional = padding. You’ll see it in email (MIME), web APIs, JWT-like payloads, and Base64 image data URLs. Remember: Base64 is not encryption; it’s only an encoding for transport.

How to use the Base64 Decoder

  1. Paste a Base64 string or upload a .b64/.txt file. We also accept full data URLs like data:image/png;base64,iVBORw0K....
  2. Select options if needed:
    • URL-safe Base64 (-, _ instead of +, /), often without padding.
    • MIME wrapped (line breaks at 76 chars) vs. no-wrap API outputs.
    • Output mode: text preview (UTF-8) or download as a binary file.
  3. Click Decode to convert Base64 to text or Base64 to file and copy/download the result.

When should you use it?

  • Extract embedded images: Decode Base64 image data URLs (PNG/JPEG/SVG) to files.
  • API debugging: Convert Base64 payloads or JWT parts for readable inspection.
  • Email/MIME: Base64 decode email attachments with line-wrapped content.
  • Config & secrets testing: Verify Base64-encoded keys or blobs in CI/CD.

Who is this for?

  • Developers & DevOps decoding Base64 strings from logs, webhooks, or storage.
  • Marketers & email teams handling MIME Base64 attachments.
  • Designers converting Base64 image data to actual files for editing.
  • QA & security reviewing Base64-encoded JSON or URL-safe Base64 tokens.

Best practices & caveats

  • Encoding matters: For text, we assume UTF-8 by default. If you see garbled characters, the source might be Windows-1252 or another charset.
  • URL-safe Base64: Replace -→+, _→/, and re-pad with = to a length divisible by 4 before decoding.
  • MIME line breaks: Ignore whitespace/newlines when decoding Base64 MIME blocks.
  • Not encryption: Base64 decoding online reveals original content—don’t rely on Base64 for secrecy.
  • Large payloads: Base64 adds ~33% overhead; prefer files or streaming for big assets.

Examples

Decode a Base64 string to text

Input:  aGVsbG8gd29ybGQ=
Output: hello world

Decode a Base64 image from a data URL

Input:
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...

Tip:
Split on the first comma and decode the right side only.
mime = "image/png"
b64  = "iVBORw0KGgoAAAANSUhEUgAA..."

Command-line references

# macOS / Linux (GNU coreutils)
base64 -d input.b64 > output.bin

# macOS (BSD base64) – decode with MIME newlines
base64 -D input.b64 > output.bin

# OpenSSL (all platforms)
openssl base64 -d -in input.b64 -out output.bin

# Windows PowerShell (decode to a file)
[IO.File]::WriteAllBytes("out.bin",
  [Convert]::FromBase64String((Get-Content in.b64 -Raw)))

Troubleshooting

“Invalid padding” or “length not multiple of 4”

Re-add = padding so the length is divisible by 4. For URL-safe Base64, also swap -→+ and _→/ before decoding.

Garbled text after decoding

The bytes are valid but not UTF-8 text. Try a different charset or download the result as a file. Many “Base64 to text online” tools default to UTF-8.

Data URL won’t decode

Ensure you’re decoding only the content after the comma. Some Base64 image converters include the header (data:...;base64,) which should not be decoded.

Similar tools

Base64 encoder

Encode any string input to Base64.

8
0

Popular tools