Text to Binary

Type anything and get its bits — UTF-8 encoded, eight bits to a byte, with the multi-byte characters that break most converters handled properly.

Runs 100% in your browserNothing is uploaded to a serverFree forever

Text

Binary

Copied!

Text is not binary until you choose an encoding

A character is an idea; a byte is a number. Turning one into the other requires a rule, and the rule this page uses is UTF-8, which is what essentially every file, database and web page has used for years. Under UTF-8 the characters you can type on a US keyboard are one byte each and identical to ASCII, so H is 72 is 01001000. Anything outside that set costs two, three or four bytes.

Each byte is written as eight bits, most significant first, padded with leading zeros. That padding is not optional: 1001000 is only seven bits, and a decoder reading a stream eight bits at a time will fall out of step on the very next character.

Characters outside ASCII

Type an accented letter or an emoji above and watch the byte count go up. UTF-8 encodes a character's code point in one to four bytes, with the first byte declaring how many follow:

One character, several bytes
CharacterWhat it isBytesBinary
ée with acute, U+00E9211000011 10101001
euro sign, U+20AC311100010 10000010 10101100
CJK for sun/day, U+65E5311100110 10010111 10100101
🐇rabbit, U+1F407411110000 10011111 10010000 10000111

This is why "how many bits is a character?" has no single answer, and why a text field that allows 100 characters is not a database column of 100 bytes. It is also why binary produced from text on one machine and read on another matches only if both agree on the encoding — a string encoded as UTF-16 or Latin-1 will produce completely different bits for the same visible characters.

The ASCII table, in binary

For the one-byte range, the mapping is fixed and worth having in front of you. Note the structure: digits start at 0011 0000, uppercase at 0100 0001, lowercase exactly 32 higher at 0110 0001 — which is why flipping bit 5 changes a letter's case.

Every printable ASCII character as eight bits
CharacterDecimalBinary
space3200100000
!3300100001
"3400100010
#3500100011
$3600100100
%3700100101
&3800100110
'3900100111
(4000101000
)4100101001
*4200101010
+4300101011
,4400101100
-4500101101
.4600101110
/4700101111
04800110000
14900110001
25000110010
35100110011
45200110100
55300110101
65400110110
75500110111
85600111000
95700111001
:5800111010
;5900111011
<6000111100
=6100111101
>6200111110
?6300111111
@6401000000
A6501000001
B6601000010
C6701000011
D6801000100
E6901000101
F7001000110
G7101000111
H7201001000
I7301001001
J7401001010
K7501001011
L7601001100
M7701001101
N7801001110
O7901001111
P8001010000
Q8101010001
R8201010010
S8301010011
T8401010100
U8501010101
V8601010110
W8701010111
X8801011000
Y8901011001
Z9001011010
[9101011011
\9201011100
]9301011101
^9401011110
_9501011111
`9601100000
a9701100001
b9801100010
c9901100011
d10001100100
e10101100101
f10201100110
g10301100111
h10401101000
i10501101001
j10601101010
k10701101011
l10801101100
m10901101101
n11001101110
o11101101111
p11201110000
q11301110001
r11401110010
s11501110011
t11601110100
u11701110101
v11801110110
w11901110111
x12001111000
y12101111001
z12201111010
{12301111011
|12401111100
}12501111101
~12601111110

Related: binary to text for the return trip, text to hex when the binary is too long to read, and the number base converter for plain numbers rather than text.

More developer tools