Technology / utility

Base64 Encoder / Decoder

Encode UTF-8 text to standard Base64 or decode valid UTF-8 Base64 text locally, with malformed-input handling and clear encoding limits.

Calculator

Calculator

Encode or decode UTF-8 Base64 text.

Convert UTF-8 text to standard padded Base64 or decode Base64 into valid UTF-8 text. Base64 is encoding, not encryption; arbitrary binary files are outside this tool.

Inputs and options

Your result

Enter details to see the result.

Complete the inputs and calculate to see the main result and its supporting breakdown.

Example

Worked example

Example inputs

Direction
UTF-8 text → Base64
Text or Base64
Hello 👋

Calculation breakdown

Encode TextEncoder UTF-8 bytes using btoa; decode canonical Base64 bytes with atob and fatal UTF-8 TextDecoder.

Example result

Converted text

SGVsbG8g8J+Riw==

Standard padded Base64 and UTF-8 text only. Content remains in this browser.

How to interpret the result

The result reversibly represents UTF-8 bytes. Emoji and non-ASCII characters use their actual byte encoding; arbitrary binary bytes that are not valid UTF-8 are rejected in text decoding.

How to use this calculator

  1. Select UTF-8 text encoding or Base64 decoding.
  2. Paste the exact text or a standard padded Base64 string.
  3. Convert locally and correct invalid Base64 or invalid UTF-8 when decoding fails.

How it works

Formula

Encode TextEncoder UTF-8 bytes using btoa; decode canonical Base64 bytes with atob and fatal UTF-8 TextDecoder.

Does Base64 hide private information?

No. Anyone can decode Base64 without a key. It is a text representation of bytes, not a confidentiality mechanism.

What this calculator does

Represent UTF-8 text as Base64 or recover valid encoded text locally; encoding does not make the text secret.

Inputs you will need

Required or selected inputs

  • Direction
  • Text or Base64

Assumptions

  • Text is UTF-8 and Base64 uses standard alphabet and padding. Base64 is reversible encoding, not encryption.

Limitations

  • At most 20,000 input characters. Base64URL, binary file output and malformed or noncanonical padded sequences are excluded.

Useful next steps

For escaping one URL component rather than Base64 text, use URL Encoder / Decoder.

See how HandyChest handles units, validation, rounding, and testing, or Report a problem with this calculator.

Good to know

Frequently asked questions

How should I read the base64 encoder / decoder result?

The result reversibly represents UTF-8 bytes. Emoji and non-ASCII characters use their actual byte encoding; arbitrary binary bytes that are not valid UTF-8 are rejected in text decoding.

Keep going