StringMash.com

Text to binary

Every character as the bits a computer actually stores, eight digits at a time.

Conversion
7 characters
Updates as you type
8 digits per byte

Using the converter

Type on the left. Eight digits appear on the right for every byte, and Separator decides whether the bytes are spaced apart or run together as one string.

Paste binary in and swap the boxes to read it back. If you want the decode direction as the starting point, the binary translator opens that way round and covers the same ground from the other end.

One character is not one byte

The sample above is deliberate. Hi is two characters and two bytes, so it costs 16 digits. The é in café is one character and two bytes, so it costs 16 on its own.

That's UTF-8. A character below 128 is stored as a single byte with a leading 0, exactly as ASCII always did. Anything above that is stored as two, three or four bytes, and the leading bits of the first byte announce how many follow. An emoji usually takes four bytes, so 32 binary digits.

Converters that assume one byte per character break here. They either mangle the accent or silently drop it. Anything this tool can't encode is reported under the output rather than quietly discarded.

A-Z AND 0-9

Every letter in eight digits

A01000001
B01000010
C01000011
D01000100
E01000101
F01000110
G01000111
H01001000
I01001001
J01001010
K01001011
L01001100
M01001101
N01001110
O01001111
P01010000
Q01010001
R01010010
S01010011
T01010100
U01010101
V01010110
W01010111
X01011000
Y01011001
Z01011010
000110000
100110001
200110010
300110011
400110100
500110101
600110110
700110111
800111000
900111001

Designed on a placemat in New Jersey

UTF-8 was sketched in September 1992 by Ken Thompson and Rob Pike, in a diner in New Jersey, on a placemat. Thompson wrote the encoder and decoder that evening and the pair had Plan 9 converted within days.

The competing proposal at the time would have broken every existing C program, because it allowed zero bytes inside a character and C strings end at the first zero. Thompson's design keeps ASCII bytes exactly as they were and guarantees no byte of a multi-byte sequence can be mistaken for an ASCII one. Old software carried on working untouched.

That property is why UTF-8 won. By 2008 it had passed every other encoding on the web, and it now accounts for over 98% of pages. A format that let people do nothing beat the formats that asked them to rewrite everything.

Related conversions

Text to hex shows the same bytes in a quarter of the space, because one hex digit stands for four binary ones. ASCII gives you the decimal code point rather than the stored bytes, and the two differ as soon as a character leaves the Latin alphabet.

To see the code point behind a character rather than its bytes, use the Unicode converter.

Questions

How do I convert text to binary?

Type it above and read the result. Each byte becomes eight binary digits, and characters outside ASCII take more than one byte.

Why is my emoji so long in binary?

Most emoji are four bytes in UTF-8, so they take 32 binary digits. Some are several code points joined together and take much more.

Is binary the same as ASCII?

No. ASCII is a table assigning numbers to characters. Binary is a way of writing those numbers. A page can be ASCII and be shown in decimal, hex or binary.

What does 01001000 mean?

It's 72 in decimal, which is a capital H. Eight digits is one byte, and for characters in the ASCII range one byte is one character.