A binary to base64 converter turns a string of ones and zeros into a compact piece of text that's safe to copy, paste and send. Base64 takes every 6 bits and writes them as one character, so long binary data becomes much shorter. Paste your bits into this binary to base64 converter and press Convert to see the Base64 text, along with the number of bytes and characters. Switch the direction to decode Base64 back into binary, shown in neat groups of eight. Everything happens in your browser, so your data stays with you.
How binary becomes Base64
- Group the bits into bytes of 8.
- Take the bytes three at a time. That's 24 bits.
- Split the 24 bits into four groups of 6.
- Turn each group into a value from 0 to 63.
- Replace each value with a character from the Base64 alphabet.
Base64 encoding produces four characters for each three input bytes. The usual alphabet is A to Z, then a to z, then 0 to 9, followed by + and /. If the data doesn't divide evenly into threes, the = sign is used for padding at the end.
How to use the binary to base64 converter
- Choose a direction.
- Paste your binary digits or your Base64 text. Spaces are ignored.
- Press Convert.
- Copy the result to use it elsewhere.
Worked examples
Take the three bytes 01001101, 01100001 and 01101110. Together they make 24 bits. Splitting them into groups of six gives 010011, 010110, 000101 and 101110, which are worth 19, 22, 5 and 46. In the Base64 alphabet those are T, W, F and u, so the answer is TWFu.
Now take a single byte, 01001101. Its first six bits are worth 19, or T. The two bits that are left are extended with zeros to 010000, which is worth 16, or Q. Because only one byte was given, two padding signs complete the group, so the result is TQ==.
What is Base64 used for?
- Sending binary data through text systems, such as email attachments.
- Putting small images inside web pages and stylesheets as data addresses.
- Storing binary values in JSON and XML, which are text formats.
- Passing tokens and keys between programs.
- Learning and debugging, when you need to see how the encoding works.
Why is Base64 bigger than the original?
Each Base64 character stores only 6 bits, but it normally takes up 8 bits when it's saved or sent. As a result, Base64 encoding increases the size of the data by about 33%. Compared with the same data written as ones and zeros, however, it's far shorter, since one character replaces six binary digits. That's why this conversion can make a long binary string so much easier to handle.
What if my bits don't fill whole bytes?
Base64 works on bytes, so the number of bits needs to be a multiple of 8. If yours isn't, this tool adds zeros to the left until it is, and it tells you how many it has added. For example, 101 becomes 00000101. Adding zeros on the left doesn't change the value of a binary number. Check that this is what you want if your bits represent something other than a number, because in that case the position of the padding may matter.
Base64 isn't encryption
Base64 can look like a secret code, but it isn't one. Anyone can decode it instantly, and no key or password is involved. Never rely on it to protect a password or any sensitive information. Its only purpose is to represent binary data using ordinary text characters. If you need secrecy, use real encryption and then apply Base64 afterward if the result needs to be sent as text.
Base64 or Base32?
Both of them turn binary into text, but they make different trade-offs. Base64 uses 64 characters, so its output is shorter. Base32 uses only 32 characters and avoids mixing upper and lower case, which makes it easier to read out or to type by hand. If you need that form, use the Base32 tool linked below.
Reading the result
When you encode, the result panel shows the Base64 text in large type, followed by the number of bytes that went in and the number of characters that came out. Every three bytes produce four characters, so you can use those two figures as a quick check. When you decode, the bits are shown in groups of eight, which makes it easy to read one byte at a time or to paste the value into another tool. Switching direction carries your latest answer across, so you can convert a value and then convert it straight back to confirm that it matches what you started with.
Does this work for files?
This page is designed for bits and short pieces of data that you can paste. It accepts up to 100,000 characters. To encode ordinary text instead of raw bits, use the Base64 encoder, which reads your words directly.
Common mistakes
- Dropping the = padding. Strict decoders will reject the text.
- Changing the letter case. Base64 treats A and a as different values.
- Confusing bits with text. Typing “101” as text gives a different result from the bits 101.
Related developer tools
Encode ordinary text with the Base64 encoder and decoder, convert between number bases with the binary to Base32 converter, and read values with the binary to decimal converter.
What next
Use this often? Add Binary to Ba to your Home screen.
Frequently asked questions
How does a binary to base64 converter work?
It groups your bits into bytes, splits every three bytes into four 6-bit values, and writes each value as a Base64 character.
Can I convert Base64 back to binary?
Yes. Choose Base64 to binary and paste your text.
What does the = sign mean in Base64?
It's padding, which is used when the data doesn't divide evenly into groups of three bytes.
Is Base64 secure?
No. Anyone can decode it. It isn't encryption.
Is my data uploaded?
No. The conversion happens in your browser.
Sources
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.