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

Frequently Asked Questions

Last updated: 2026-05-23 · Reviewed by Nham Vu