MyAICalc Logo
MyAICalc Free Online Calculators
Developer Utility

Base64 Encoder & Decoder

Encode standard text into Base64 format or decode Base64 strings back to clean UTF-8 text.

Input String

13 chars | 13 bytes

Output Result

Technical Encyclopedia

Understanding
Base64 Encoding

Base64 is a group of binary-to-text encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation.

Why Use Base64?

Base64 is designed to carry data across channels that are built to support only text transmission, such as email (MIME), XML, JSON, or URL query parameters:

  • Safe Transmission: Prevents network equipment or legacy software from modifying control characters or non-printable binary streams.
  • Embed Assets: Often used to embed small binary files, such as images or icons, directly inside CSS files or HTML source markup.

How Base64 Works

The Base64 alphabet consists of 64 characters: uppercase letters `A-Z`, lowercase letters `a-z`, digits `0-9`, and symbols `+` and `/`.

  • Every group of 3 bytes (24 bits) of input data is divided into 4 chunks of 6 bits each.
  • Each 6-bit chunk maps to one of the 64 characters in the index sheet.
  • If the input bytes are not divisible by 3, the final Base64 string is padded with one or two `=` characters. E.g. "A" (1 byte) becomes "QQ==".

How the calculation works

Base64 turns each group of 3 bytes into 4 characters from a 64-character alphabet.

“Hi” in ASCII is bytes 72 and 105. Those 16 bits plus padding become SGk=

Padding with “=” marks a final group that was not 3 bytes long.

Worked example: the text Hi

  1. H is byte 72, i is byte 105.
  2. The Base64 text is SGk=.
  3. Decoding SGk= returns Hi.

Short strings

TextBase64
HiSGk=
AQQ==
YesWWVz

Frequently asked questions

What is the Base64 encoding of Hi?▼
SGk=.
What does the equals sign mean?▼
Padding, because the last group had fewer than 3 bytes.
What is the encoding of the single letter A?▼
QQ==.