Binary to Base64 Converter

Convert a binary (base-2) integer to its Base64 encoded representation with a step-by-step explanation.

Binary Input

Quick examples

Base64 Output

Enter a binary number and press Convert

Copied!

Summary

Convert a binary (base-2) integer to its Base64 encoded representation with a step-by-step explanation.

How it works

  1. Enter a binary number (digits 0 and 1) into the input field.
  2. The binary string is padded on the left to make its length a multiple of 8, forming complete bytes.
  3. Each 8-bit byte is collected into a byte array.
  4. The byte array is split into 3-byte groups (24 bits each), then each group is divided into four 6-bit chunks.
  5. Each 6-bit value (0–63) is mapped to a character in the Base64 alphabet (A–Z, a–z, 0–9, +, /).
  6. Padding characters (=) are appended when the input byte count is not a multiple of 3.

Use cases

  • Convert binary-encoded data to Base64 for safe embedding in JSON, HTML, or URLs.
  • Learn how Base64 encoding works at the bit level.
  • Verify manual Base64 encoding of a binary value against a trusted reference.
  • Cross-check the output of programming language Base64 libraries.
  • Encode binary flags or bitmasks for storage in text-based formats.
  • Understand the 4/3 size expansion that Base64 introduces.

Frequently Asked Questions

Last updated: 2026-06-13 · Reviewed by Nham Vu