Binary to Base64 Converter
Convert binary bytes to Base64 online. Enter 8-bit binary data, a continuous binary byte stream, or separated byte groups and encode the exact byte sequence into standard Base64 with decimal, hexadecimal and byte-level details.
—
—
—
Binary to Base64 Converter
The Binary to Base64 Converter transforms binary byte data into a Base64 string. Instead of interpreting the binary as readable text first, this tool works directly with the byte values represented by the input bits. This makes it useful for encoding arbitrary binary data as well as binary representations of text.
Base64 is frequently used when binary data must be transported through systems that are designed primarily for text. Common examples include web APIs, JSON, XML, MIME email, data URLs, authentication tokens and software configuration formats.
How to Convert Binary to Base64
Enter your binary bytes in groups of eight bits. You can separate the bytes with spaces, commas, colons, hyphens or line breaks. A continuous binary string is also accepted when its length is a multiple of eight.
Click Convert Binary to Base64. The calculator converts each 8-bit group into a byte and feeds the complete byte sequence into the Base64 encoding process.
Binary:
01001000 01100101 01101100 01101100 01101111
Hex bytes:
48 65 6C 6C 6F
Bytes interpreted as:
H e l l o
Base64:
SGVsbG8=How Base64 Encoding Works
Base64 represents binary data using a set of 64 printable characters. Since 64 different values can be represented with six bits, the encoder reorganizes the original byte stream into groups of six bits.
3 input bytes
= 24 bits
24 bits
÷ 6 bits
= 4 Base64 valuesThis is why three bytes normally produce four Base64 characters.
Binary Bytes to Base64 Example
Consider the three ASCII-compatible bytes for the text ABC. The Base64 encoder does not need to know that those bytes represent letters; it encodes the byte values themselves.
Binary bytes:
01000001
01000010
01000011
Combined bits:
010000010100001001000011
Split into 6-bit groups:
010000 010100 001001 000011
Decimal indexes:
16 20 9 3
Base64:
QUJDBase64 Alphabet
Standard Base64 uses uppercase letters, lowercase letters, digits and two additional symbols. Each character corresponds to a six-bit value from 0 through 63.
| Index Range | Base64 Characters |
|---|---|
| 0–25 | A–Z |
| 26–51 | a–z |
| 52–61 | 0–9 |
| 62 | + |
| 63 | / |
What Is Base64 Padding?
Base64 operates most naturally on groups of three input bytes. If the final block contains only one or two bytes, padding is used in standard Base64 so the encoded output remains aligned to groups of four characters.
1 input byte:
M
Base64:
TQ==
Padding:
2 characters
2 input bytes:
Ma
Base64:
TWE=
Padding:
1 character
3 input bytes:
Man
Base64:
TWFu
Padding:
NoneStandard Base64 vs Base64URL
Standard Base64 uses the characters + and /. Base64URL is designed for URLs and filename-safe contexts, so those two characters are replaced with a hyphen and underscore.
| Value | Standard Base64 | Base64URL |
|---|---|---|
| 62 | + | – |
| 63 | / | _ |
This calculator can generate either standard Base64 or Base64URL. For Base64URL output, trailing equals-sign padding is removed.
Binary to Base64 Is a Byte Conversion
A common mistake is to treat the visible characters 0 and 1 as text and then Base64-encode those characters. That produces a completely different result. This tool interprets the bits as binary byte values first.
Binary byte:
01000001
Actual byte value:
65
Character representation:
A
Correct Base64 of byte 65:
QQ==Encoding the literal text “01000001” would instead encode eight ASCII characters and produce a different Base64 string.
Continuous Binary to Base64
You can remove the spaces between input bytes as long as the overall bit count is divisible by eight. The decoder automatically separates the stream into bytes before Base64 encoding.
With spaces:
01000001 01000010 01000011
Continuous:
010000010100001001000011
Both encode to:
QUJDWhy Convert Binary to Base64?
Raw binary data cannot always be inserted safely into text-oriented formats. Some byte values may correspond to control characters, null bytes or other values that are difficult to transport or display. Base64 replaces the raw bytes with printable characters while preserving the original byte sequence.
When decoded correctly, the resulting Base64 data reconstructs the same original binary bytes.