Skip to content
CalcSpectrum

Base64 Encode/Decode Calculator

Encode text to Base64 or decode Base64 back to text, with correct UTF-8 handling for Unicode and emoji.

Free to use · Instant results

Calculator Inputs

Decoding requires valid Base64 (correct characters, length, and padding).

Result
Your spreadsheet is generated in your browser.

About these results

CalcSpectrum calculators produce automated estimates using established formulas and the specific values you enter. Because real-world outcomes depend on input accuracy, mathematical assumptions, and rounding conventions, please verify critical figures with an appropriately qualified financial, tax, medical, legal, or other professional, as relevant.

How It's Calculated

Formula

Base64=encode64(UTF-8 bytes of text)\text{Base64} = \text{encode}_{64}(\text{UTF-8 bytes of text})

Base64 is an encoding scheme that represents arbitrary bytes as printable ASCII text, using 64 characters (A-Z, a-z, 0-9, +, /) plus '=' padding. It is NOT encryption: anyone can decode Base64 back to the original data with no key, so it must never be used to protect secrets. This calculator first converts input text to UTF-8 bytes (so Unicode text, emoji, and non-Latin scripts round-trip correctly), then encodes those bytes to Base64, or reverses the process for decoding. Malformed Base64 input (invalid characters, invalid length, invalid padding, or bytes that don't form valid UTF-8 once decoded) is rejected rather than silently repaired.

Worked Examples

Encode 'hello'

  1. UTF-8 bytes of 'hello': 68 65 6c 6c 6f.
  2. Group bytes into 6-bit chunks and map each to a Base64 character.
  3. Result: aGVsbG8=

Decode 'aGVsbG8='

  1. Map each Base64 character back to its 6-bit value.
  2. Regroup bits into 8-bit bytes: 68 65 6c 6c 6f.
  3. Decode UTF-8 bytes to text: hello

Frequently Asked Questions

Is Base64 encryption?

No. Base64 is a reversible encoding with no key or secret involved. Anyone can decode Base64 text back to its original form, so it provides no confidentiality.

Why does decoding sometimes fail?

Decoding fails when the input is not valid Base64: it contains characters outside A-Z, a-z, 0-9, +, /, =, has an invalid length, has malformed padding, or the decoded bytes are not valid UTF-8 text.

Does this handle Unicode and emoji correctly?

Yes. Text is converted to UTF-8 bytes before encoding, and decoded bytes are parsed as UTF-8, so non-Latin scripts and emoji round-trip correctly.

What does an empty input produce?

Encoding empty text produces an empty Base64 result, and decoding an empty string produces empty text.