Cloudesk

Base64 Utility

Encode and decode Base64 for text and binary files

Text → Base64

Usage Tips

  • Charset affects how characters are converted to bytes before encoding. UTF-8 is the standard and covers all Unicode characters.
  • ISO-8859-1 (Latin-1) uses one byte per character and only covers Western European characters (U+0000–U+00FF). Characters outside this range are truncated to their low byte.
  • Standard Base64 uses + and / characters. If you need to embed Base64 in a URL, replace + with - and / with _ after encoding.
  • The = padding at the end ensures the output length is always a multiple of 4. One = means 1 padding byte; == means 2.

How Base64 Works

6-Bit Encoding

Every 3 input bytes (24 bits) are split into four 6-bit groups. Each 6-bit group maps to one of 64 printable characters: A–Z (values 0–25), a–z (26–51), 0–9 (52–61), + (62), and / (63). This is why Base64 output is always ~33% larger than the original.

Padding (=)

If the input length is not a multiple of 3 bytes, one or two = characters are appended so the output length is always a multiple of 4. One = means 1 padding byte was added; == means 2 padding bytes were added.

Common Use Cases

Data URIs (embedding images in CSS/HTML), MIME email attachments (RFC 2045), JSON payloads carrying binary data, HTTP Basic Authentication headers (username:password), and storing binary blobs in text-only systems like databases or configuration files.

Usage Tips

  1. 1Switch between the Text and File tabs to process a string or a binary file.
  2. 2In Text mode, select Encode or Decode, pick a charset, and paste your content into the input field.
  3. 3The output updates instantly — click Copy to grab the result or switch the output format to HEX.
  4. 4In File mode, choose any file to encode it as Base64, or pick a Base64 .txt file to recover the original binary.

Related Tools