Base64 Encoder/Decoder

Type or paste text to encode it to Base64, or paste Base64 to decode it back - calculated instantly and correctly, with full UTF-8 support.

READY — Choose Encode or Decode, then enter text or choose a local file.

Convert UTF-8 text and file bytes locally. Standard Base64 and URL-safe Base64 are available; Base64 is not encryption.

Conversion Settings

Operation
Source
Alphabet

Standard Base64 output uses +, / and = padding. Decoder accepts correctly formatted padded or unpadded input and ignores ASCII whitespace.

Input

Text mode: up to 2 MiB of UTF-8 bytes. Small inputs convert automatically.

Output

Nothing converted yet.
Source bytes—
Result bytes—
Output characters—
Byte preview (first 32 bytes, hexadecimal)
—

Privacy & limits: Encoding and decoding run in this browser; this widget does not send your input or selected file to a server. Local file access starts only after you select the file and click Convert. Each conversion supports at most 2 MiB of decoded/raw bytes; oversized input is refused rather than silently truncated. Binary data may not be valid UTF-8: in that case download the exact decoded bytes instead of copying text. Avoid putting secrets into Base64—anyone can reverse it.

★ ★ ★ ★ ★
No ratings yet — be the first

What Is a Base64 Encoder/Decoder?

This tool converts text to and from Base64, a standard encoding scheme that represents binary or text data using only 64 printable ASCII characters. It's commonly used to safely embed data in places that only handle plain text - inside JSON, URLs, email attachments, or configuration files - and this tool performs genuine encoding and decoding calculations directly using your browser's built-in Base64 functions, with correct handling for non-English characters and symbols.

How to Use the Base64 Encoder/Decoder

  1. Choose Encode or Decode. Encode converts UTF-8 text or the exact bytes of a local file into Base64; Decode converts Base64 back into its original bytes.
  2. Select Text / Paste or Local File. For text, type or paste in the input box. Small inputs convert automatically; click Convert for longer text. In file mode, choose one local file, then click Convert to read it locally. When decoding a file, choose a UTF-8 text file containing Base64 characters.
  3. Select the matching alphabet. Standard uses +, / and = padding. URL-safe uses - and _, with no padding on encoded output. Choose the same mode that was used to encode your incoming data.
  4. Inspect the result. Read the output, input/output byte counts and 32-byte hex preview. If decoded data is binary or invalid UTF-8, the tool shows that explicitly rather than corrupted text.
  5. Copy, download, swap or reset. Copy Output works for text, Download Result saves encoded text or exact decoded bytes, Swap Text reverses a text conversion, and Reset clears the current input and file selection.
  6. Observe size and privacy limits. Conversions are performed within your browser with a 2 MiB raw/decoded-byte limit. Oversized data is refused, not truncated. Your chosen file is never uploaded by this converter.

How It Works

Base64 maps three binary bytes to four printable characters. This tool uses TextEncoder to turn Unicode text into real UTF-8 bytes before Base64 encoding; during decoding, it validates the selected Base64 alphabet, length, padding, and unused bits, then recovers the original bytes using native atob(). Valid UTF-8 bytes are shown as text using strict TextDecoder; arbitrary binary bytes remain available to download exactly as decoded. The tool uses bounded, chunked btoa() conversion for file data and refuses inputs larger than its documented size limit.

Understanding Your Results

  • Encoded output looks like letters, numbers, and symbols — that is normal; Base64 is text representation of bytes, not encryption.
  • Decoding reports invalid alphabet, length, or padding — check for typos or choose the correct Standard / URL-safe alphabet. Whitespace between Base64 characters is ignored, but other extraneous characters are not accepted.
  • Decoded binary / invalid UTF-8 — successful byte decoding does not guarantee that the bytes represent human-readable text. Use Download Result to save the exact bytes.
  • Output grows by roughly one-third — Base64 normally needs four printable characters for every three source bytes; URL-safe output omits optional trailing padding.
  • Bytes vs characters — Unicode text can use multiple UTF-8 bytes per displayed character, so input and output lengths may differ.

Browser Limitations

This tool processes text and selected files entirely inside the browser. For responsiveness, each conversion is limited to 2 MiB of raw or decoded bytes, and a Base64-text file must be no larger than 3 MiB. File selection does not initiate a file upload: the browser reads it only when you explicitly choose Convert. The tool does not guess original file extensions, mime types or filenames from Base64 bytes; decoded binary is downloaded as decoded-bytes.bin. Local downloads and clipboard copying depend on browser support and permissions. The converter expects raw Base64 rather than an entire data: URL.

Common Mistakes to Avoid

  • Trying to decode plain text as if it were Base64 - only genuinely Base64-encoded input will decode successfully; regular text will typically produce an error.
  • Assuming Base64 is encryption - it's purely an encoding scheme for safely representing data as text, not a security or privacy measure; anyone can decode it instantly.
  • Copying output with extra whitespace or line breaks accidentally included - check the copied result carefully if pasting it somewhere that's sensitive to exact formatting.

Frequently Asked Questions

Is Base64 encoding the same as encryption?

No, Base64 is simply a way of representing data using text-safe characters - it provides no security or confidentiality, since anyone can decode it instantly using any standard Base64 tool.

Why does encoded text always look longer than the original?

Base64 encoding represents binary data using a limited character set, which mathematically requires roughly 33% more characters than the original data to represent it fully.

Why did decoding fail on my input?

Valid Base64 uses only a specific set of characters (letters, numbers, plus, slash, and padding equals signs); any input containing other characters, or with incorrect length padding, will fail to decode.

Does this tool support emoji and non-English characters?

Yes, this tool properly handles UTF-8 encoding, so emoji, accented characters, and non-Latin scripts encode and decode correctly and reversibly.

Is my text sent to a server for encoding or decoding?

No, all conversion happens instantly in your browser using built-in JavaScript functions - nothing you type is transmitted anywhere.

Conclusion

Whether you're debugging an API response, decoding a configuration value, or preparing data for transport, this gives you fast, accurate, correctly-handled Base64 conversion. For working with structured data more broadly, check the JSON Formatter & Validator.