Binary to Text Converter
Convert between binary and text.Runs in this tab.⌘ ↵ runs it
Next step
Turn a click-through into an interactive demo
AtriumKit records your web app once in Chrome and turns every click into a step of a demo you can embed or share. There’s a free plan.
Try AtriumKit freeAbout Binary to Text Converter
How text becomes 8-bit groups
The encoder runs your text through UTF-8 (the browser’s TextEncoder), then writes each byte as exactly eight binary digits, zero-padded on the left and separated by a single space. ASCII characters are one byte each, so “Hi” becomes two groups:
Hi → 01001000 01101001
A few values worth recognizing:
| Char | Decimal | Hex | Binary |
|---|---|---|---|
A |
65 | 0x41 | 01000001 |
Z |
90 | 0x5A | 01011010 |
a |
97 | 0x61 | 01100001 |
z |
122 | 0x7A | 01111010 |
0 |
48 | 0x30 | 00110000 |
9 |
57 | 0x39 | 00111001 |
| space | 32 | 0x20 | 00100000 |
| newline | 10 | 0x0A | 00001010 |
Two patterns fall out of the table. Upper- and lowercase letters differ only in the third bit from the left (value 32), so flipping that one bit toggles case. Digits are 0011 followed by the digit’s own 4-bit value. Line breaks in your input are encoded too, so a trailing newline adds 00001010 to the end of the output.
ASCII vs UTF-8: why some characters take 16, 24 or 32 bits
Anything outside ASCII becomes several bytes. The first byte’s leading bits tell a decoder how many bytes belong to the character: 110 starts a 2-byte sequence, 1110 a 3-byte one, 11110 a 4-byte one, and every continuation byte starts with 10.
é → 11000011 10101001
€ → 11100010 10000010 10101100
😀 → 11110000 10011111 10011000 10000000
So “café” is five groups, not four. This is the usual reason two converters disagree: a tool that assumes Latin-1 (or Windows-1252) encodes é as the single byte 11101001. Paste that lone byte here and you get �, because this decoder always reads UTF-8, and 11101001 on its own is not a complete UTF-8 sequence. To see the code point and byte layout of each character separately, use the UTF-8 byte viewer.
What the decoder accepts, and what it does with bad input
Knowing the parsing rules saves debugging time:
- Any character other than 0 and 1 is a separator. Spaces, commas, tabs and line breaks all work, so
01001000,01101001and one-byte-per-line input both decode to “Hi”. - Leading zeros are optional.
1001000 1101001(7-bit groups) also gives “Hi”, because each group is read as a number. - You need separators between bytes. Without them the whole run is read as one number and only its lowest 8 bits survive, so
0100100001101001decodes to justi. Split long strings into 8-digit groups first (see the one-liners below). - Strip
0bprefixes. Thebacts as a separator, so the leading0becomes its own group:0b01001000decodes to a NUL byte followed by “H”. - Groups longer than 8 digits wrap. Only the low 8 bits are kept:
101000001(decimal 321) decodes asA. - Broken or truncated UTF-8 doesn’t raise an error. An incomplete multi-byte sequence becomes the replacement character U+FFFD (
�) and the rest of the text still decodes. The only error is input with no 0s or 1s at all. - A dropped digit fails silently.
01001000 0110100 1decodes to “H4” plus a control character, not “Hi”. If the output looks wrong, check that the total digit count is a multiple of 8.
Command-line and code equivalents
# Text → binary (offset, bits, then the printable-ASCII column)
printf 'Hi' | xxd -b
# 00000000: 01001000 01101001 Hi
# Binary with no spaces → text
echo 0100100001101001 | perl -lpe '$_=pack"B*",$_'
# Insert a space every 8 bits so this tool can read it
echo 0100100001101001 | sed 's/.\{8\}/& /g'
' '.join(f'{b:08b}' for b in 'café'.encode())
bytes(int(b, 2) for b in '01001000 01101001'.split()).decode()
[...new TextEncoder().encode('Hi')].map(b => b.toString(2).padStart(8, '0')).join(' ')
new TextDecoder().decode(new Uint8Array('01001000 01101001'.split(' ').map(b => parseInt(b, 2))))
Python’s .decode() raises UnicodeDecodeError on an incomplete sequence; pass errors='replace' to get the same � behavior as this tool. JavaScript’s TextDecoder replaces by default, which is what runs here.
“Binary-to-text encoding” usually means Base64 or hex
If you searched for binary-to-text encoding because you need to put a file, hash or key into JSON, a URL or an email, you want a different tool. In that sense (as in RFC 4648), the term covers schemes that represent arbitrary bytes with printable characters, and base-2 is the least compact option:
| Encoding | Output chars per byte | Hi! encoded |
|---|---|---|
| Binary (this tool) | 8, plus a separator | 01001000 01101001 00100001 |
| Hex | 2 | 486921 |
| Base64 | about 1.33 | SGkh |
Use the hex to text converter for hex dumps and the Base64 encoder/decoder for data you need to embed or transmit. Binary is the right view when you care about individual bits: flags, masks, or how UTF-8 lays out a character.
Questions
How does binary-to-text conversion work?
What binary format is used?
Can I convert binary back to text?
Why do computers use binary?
Is the binary converter safe for private data?
How do I convert binary to decimal?
Comments
More in Encoding & Decoding
- Base64 Encoder / Decoder
- URL Encoder / Decoder
- HTML Entity Encoder / Decoder
- JWT Decoder
- Base32 Encoder / Decoder
- ROT13 Encoder / Decoder
- Morse Code Translator
- Hex to Text Converter
Comments