Base64 Files
UTF-8 · ASCII · Instant Decode

Base64 to Text Decoder

Decode Base64 strings to readable text with UTF-8 encoding support. Paste a raw Base64 string or data:text/plain;base64, Data URL for instant decoded text.

Base64 to Text Decoder

Paste a Base64 string above, then click Decode

Have text to encode to Base64?

Encode plain text, Unicode, JSON, HTML, or code snippets to Base64 with live output.

Text to Base64

How to Decode Base64 to Text

1

Paste Base64

Paste a raw Base64 string or a Data URL starting with data:text/plain;base64, into the input box.

2

Choose encoding

Select UTF-8 (default, supports all Unicode text) or ASCII (7-bit, strict ASCII characters). Then click Decode.

3

Copy or Download

Copy the decoded text to your clipboard or download it as a .txt file.

What Is Base64 Text Encoding?

Base64 encodes binary data — including text — into a safe sequence of 64 printable ASCII characters. Text is commonly encoded as Base64 when it needs to pass through ASCII-only systems: email headers, HTTP Basic Auth, JWT payloads, and JSON fields are all common scenarios.

In JavaScript, use btoa() to encode text as Base64 and atob() to decode it. On the command line, use base64 -d.

  • JWT token payload (the middle segment)
  • HTTP Basic Auth credentials (Authorization header)
  • Email subject lines and body text (MIME)
  • Encoded query strings or config values in APIs
  • Embedded text content in HTML data attributes

Decoding Base64 in JavaScript

JavaScript — decode Base64 text

// Simple ASCII — works for English text
const text = atob('SGVsbG8sIFdvcmxkIQ==')
// → "Hello, World!"

// UTF-8 — handles all Unicode characters
function decodeBase64Utf8(b64) {
  const binary = atob(b64)
  const bytes = Uint8Array.from(binary, (c) =>
    c.charCodeAt(0)
  )
  return new TextDecoder('utf-8').decode(bytes)
}

decodeBase64Utf8('5L2g5aW9')
// → "你好"

Common Error Messages

What each error means and how to resolve it.

The Base64 input appears to be invalid

When it occurs

The input contains characters not valid in Base64 (outside A–Z, a–z, 0–9, +, /, =) or the string is missing padding.

How to fix

Check for extra spaces, newlines, or a truncated string. Valid Base64 length is always a multiple of 4 (with = padding).

The decoded content is not valid UTF-8 text

When it occurs

Decoding produces binary data — such as a PDF, image, or ZIP file — rather than a text string.

How to fix

To recover the file, use the Base64 to File tool instead. If you expected text, confirm the Base64 was originally encoded from a text source.

Go to Base64 to File →

This looks like binary data

When it occurs

The decoded content is technically valid UTF-8 but contains null bytes or a high proportion of control characters — indicating the original data was a binary file, not text.

How to fix

The output is shown but may contain garbled characters. If this is a file, use the Base64 to File tool to download it correctly.

Go to Base64 to File →

Frequently Asked Questions

What does it mean to decode Base64 to text?

Base64 encoding converts binary data or text into a safe ASCII string using 64 printable characters. Decoding is the reverse: it turns a Base64 string back into the original text. For example, SGVsbG8= decodes to Hello.

How do I decode Base64 in JavaScript?

For simple ASCII strings, use atob(): atob("SGVsbG8=") → "Hello". For UTF-8 text (characters outside the ASCII range), combine atob() with TextDecoder to handle multi-byte characters correctly. This tool handles both cases automatically.

Why does the decoded result look like gibberish?

The Base64 was likely encoded from binary data (a file) rather than text. Binary data decoded as UTF-8 text displays as random symbols. Use the Base64 to File tool to recover the original file.

What is the difference between UTF-8 and ASCII decoding?

ASCII supports 128 characters (English letters, digits, punctuation). UTF-8 supports all Unicode characters — accented letters, CJK characters, emoji, and more. UTF-8 is the safer choice unless you know the source is pure ASCII.

Can I decode Base64 back to a file?

Not with this tool — it decodes to readable text only. To recover a PDF, image, or font from Base64, use the Base64 to File tool, which supports binary decoding and direct file download.

Where is my data processed?

Entirely in your browser. The Base64 string is decoded locally using the browser's built-in Web Crypto and TextDecoder APIs — nothing is sent to any server.