Text to binary: what a string looks like at the byte level
What this conversion does
It encodes text into bytes using UTF-8 and then writes each byte as eight binary digits. Nothing here is arithmetic — a character is looked up in a table and written out — but the result is the actual sequence of ones and zeros that would be stored or transmitted for that string.
Why UTF-8 and not plain ASCII
ASCII only defines 128 characters, which covers English comfortably and everything else not at all. UTF-8 keeps the first 128 codes identical to ASCII and extends the rest across two, three or four bytes, so an English string produces exactly the bytes ASCII would while a Chinese character or an emoji still works. That is why "A" is one byte and a single Chinese character is three.
Text to binary conversion table
Short strings with their binary byte sequences. The multi-byte rows are the interesting ones: they show how a single character becomes a group of bytes, each with a recognisable leading pattern.
| Text | Binary |
|---|---|
| A | 01000001 |
| Hi | 01001000 01101001 |
| OK | 01001111 01001011 |
| 123 | 00110001 00110010 00110011 |
| ! | 00100001 |
| Go | 01000111 01101111 |
The byte you were not expecting
The most common surprise in text handling is a string that is longer than it looks. Five characters may be five bytes or fifteen, depending on the script, and any length limit expressed in characters will be violated by a limit expressed in bytes. Seeing the byte sequence makes that concrete: the leading bits of each byte in a multi-byte character announce how many bytes the character occupies.
Byte counts and character counts differ
When a database column, an API limit or a header field is measured in bytes, count the bytes rather than the characters. The converter shows the byte sequence directly, so the number of groups is the number of bytes, which is the figure those limits are actually checking.
Frequently asked questions
How does text become binary?
Each character is looked up in the UTF-8 encoding table and replaced by its byte value or values, and each byte is then written as eight binary digits. The letter A is byte 65, which is 01000001, and it takes exactly one byte because it is inside the original ASCII range.
Why is one Chinese character more than one byte?
Because UTF-8 needs to cover far more than 256 characters, so characters outside the first 128 are spread over two, three or four bytes. A single Chinese character normally takes three bytes, which is why it appears here as three groups of eight digits rather than one.
Is this the same as ASCII?
For plain English text, yes — UTF-8 was designed so that the first 128 codes are byte-for-byte identical to ASCII, so "Hello" encodes the same way under both. They diverge the moment you use an accented letter, a currency symbol or any non-Latin script, where ASCII has nothing to offer and UTF-8 does.
Why are the bytes separated by spaces?
Because a continuous run of binary is unreadable and easy to miscount, while space-separated groups of eight show the byte boundaries directly. Spaces in the input are ignored when decoding, so a sequence copied out of this page can be pasted back the other way without editing.
Can it handle emoji?
Yes. Emoji sit above the range that three bytes can reach, so UTF-8 encodes most of them in four bytes, and they appear here as four groups of eight digits. A single emoji can therefore be longer than a short English word once it is encoded.