Skip to main content
Calctrove Calctrove

Base64 Encode Decode

Base64 encode/decode

Convert UTF-8 text to Base64 and decode Base64 back to text locally in your browser.

Result

36chars

Encoded UTF-8 input to Base64.

InputsEncode27 in • 36 outLive

Live encoding

Input chars

27

Output chars

36

Input bytes

27

Output bytes

36

How it was processed

Encoded UTF-8 input to Base64.

LaTeX formula

\text{Base64}=\text{Encode}_{UTF-8}(\text{input})

Step-by-step

  1. Step 1: Convert text into UTF-8 bytes.
  2. Step 2: Group bytes into 24-bit chunks and map each 6-bit value to the Base64 alphabet.
  3. Step 3: Keep = padding for canonical Base64 output.
Flow
  • Encoding converts UTF-8 text bytes into Base64-safe text characters.
  • Decoding reverses Base64 back into UTF-8 bytes and then plain text.
  • Input validation rejects malformed Base64 and invalid padding during decode.
Example

Worked example: "hello world"

  1. 1 Input text = "hello world"
  2. 2 UTF-8 bytes are transformed to Base64
  3. 3 Output = "aGVsbG8gd29ybGQ="

The Base64 representation of "hello world" is "aGVsbG8gd29ybGQ=".

How
  1. Select Encode to convert plain text into Base64, or Decode to reverse Base64 text.
  2. Paste text into the matching input box.
  3. Copy transformed output or reset the current mode when needed.
Avoid
  • Pasting URL-safe Base64 variants without converting "-" and "_" to standard Base64 characters first.
  • Forgetting padding characters when manually editing encoded text.
  • Assuming binary file content can always be safely interpreted as UTF-8 decoded text.
FAQ
Is my input data sent to a server?

No. Encoding and decoding are performed entirely in-browser.

Why does decode fail on some Base64 strings?

The tool validates length, allowed characters, and padding. Malformed Base64 is rejected with an input error.

Can this decode arbitrary binary files?

This tool decodes into UTF-8 text. Non-text binary payloads may fail UTF-8 decoding.

Switch
Switch12