Base64 Encoder/Decoder

Encode text to Base64 or decode it back.

Overview

Encodes binary and ASCII/UTF-8 text into standard Base64 representation and decodes Base64 strings back to clean plaintext.

Formula & Calculation Method

Base64 = Map_6Bit_Chunks_To_Alphabet(ASCII_Binary, RFC_4648)

Groups 8-bit bytes into 6-bit chunks, mapping each chunk to a 64-character ASCII alphabet (A-Z, a-z, 0-9, +, /) with '=' padding.

Worked Example: Encoding 'Calciverse' into Base64

Inputs: Input Plaintext = 'Calciverse'

  • Convert ASCII characters into 8-bit binary stream.
  • Re-group binary bits into 6-bit index blocks.
  • Map index blocks to Base64 character index table = 'Q2FsY2l2ZXJzZQ=='

Summary: Plaintext = 'Calciverse' | Base64 Encoded = 'Q2FsY2l2ZXJzZQ=='

Common Use Cases

  • Data URIs: Embed small PNG or SVG images directly into CSS and HTML stylesheets without extra HTTP requests.
  • Basic Authentication: Encode 'username:password' strings for HTTP Authorization headers.
  • Binary Payload Transmission: Transmit raw binary files safely across text-only protocols like SMTP email.

Frequently Asked Questions

Is Base64 an encryption algorithm?

No. Base64 is an encoding format designed for safe data transmission across text channels; it offers zero cryptographic security.

Why does Base64 output end with '=' signs?

The '=' symbol is padding used when the input byte length is not evenly divisible by 3, ensuring 4-character alignment.

What is URL-safe Base64?

A variant that replaces '+' with '-' and '/' with '_' to prevent conflicts with URL query string reserved characters.

Related Calculators & Tools

  • JSON Formatter - Pretty-print, minify and validate JSON.
  • Color Picker - Pick a color and read off HEX, RGB and HSL instantly.
  • Regex Tester - Test a regular expression against sample text with live match highlighting.
  • HTML Formatter - Indent and clean up messy HTML markup.
  • SQL Formatter - Readable indentation for SQL queries.
  • CSS Minifier - Strip whitespace and comments from CSS to shrink file size.