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
Base64 result
Copied to clipboard!
Input bits
Bytes encoded
Output chars
Step 1 — Binary padded to bytes
Step 2 — 6-bit groups and Base64 characters
| Group | 6-bit chunk | Decimal | Base64 char |
|---|
Copied!
Summary
Convert a binary (base-2) integer to its Base64 encoded representation with a step-by-step explanation.
How it works
- Enter a binary number (digits 0 and 1) into the input field.
- The binary string is padded on the left to make its length a multiple of 8, forming complete bytes.
- Each 8-bit byte is collected into a byte array.
- The byte array is split into 3-byte groups (24 bits each), then each group is divided into four 6-bit chunks.
- Each 6-bit value (0–63) is mapped to a character in the Base64 alphabet (A–Z, a–z, 0–9, +, /).
- 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-05-23 ·
Reviewed by Nham Vu