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 browser•Nothing is uploaded to a server•Free forever
Text
Binary
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:
| Character | What it is | Bytes | Binary |
|---|---|---|---|
é | e with acute, U+00E9 | 2 | 11000011 10101001 |
€ | euro sign, U+20AC | 3 | 11100010 10000010 10101100 |
日 | CJK for sun/day, U+65E5 | 3 | 11100110 10010111 10100101 |
🐇 | rabbit, U+1F407 | 4 | 11110000 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.
| Character | Decimal | Binary |
|---|---|---|
space | 32 | 00100000 |
! | 33 | 00100001 |
" | 34 | 00100010 |
# | 35 | 00100011 |
$ | 36 | 00100100 |
% | 37 | 00100101 |
& | 38 | 00100110 |
' | 39 | 00100111 |
( | 40 | 00101000 |
) | 41 | 00101001 |
* | 42 | 00101010 |
+ | 43 | 00101011 |
, | 44 | 00101100 |
- | 45 | 00101101 |
. | 46 | 00101110 |
/ | 47 | 00101111 |
0 | 48 | 00110000 |
1 | 49 | 00110001 |
2 | 50 | 00110010 |
3 | 51 | 00110011 |
4 | 52 | 00110100 |
5 | 53 | 00110101 |
6 | 54 | 00110110 |
7 | 55 | 00110111 |
8 | 56 | 00111000 |
9 | 57 | 00111001 |
: | 58 | 00111010 |
; | 59 | 00111011 |
< | 60 | 00111100 |
= | 61 | 00111101 |
> | 62 | 00111110 |
? | 63 | 00111111 |
@ | 64 | 01000000 |
A | 65 | 01000001 |
B | 66 | 01000010 |
C | 67 | 01000011 |
D | 68 | 01000100 |
E | 69 | 01000101 |
F | 70 | 01000110 |
G | 71 | 01000111 |
H | 72 | 01001000 |
I | 73 | 01001001 |
J | 74 | 01001010 |
K | 75 | 01001011 |
L | 76 | 01001100 |
M | 77 | 01001101 |
N | 78 | 01001110 |
O | 79 | 01001111 |
P | 80 | 01010000 |
Q | 81 | 01010001 |
R | 82 | 01010010 |
S | 83 | 01010011 |
T | 84 | 01010100 |
U | 85 | 01010101 |
V | 86 | 01010110 |
W | 87 | 01010111 |
X | 88 | 01011000 |
Y | 89 | 01011001 |
Z | 90 | 01011010 |
[ | 91 | 01011011 |
\ | 92 | 01011100 |
] | 93 | 01011101 |
^ | 94 | 01011110 |
_ | 95 | 01011111 |
` | 96 | 01100000 |
a | 97 | 01100001 |
b | 98 | 01100010 |
c | 99 | 01100011 |
d | 100 | 01100100 |
e | 101 | 01100101 |
f | 102 | 01100110 |
g | 103 | 01100111 |
h | 104 | 01101000 |
i | 105 | 01101001 |
j | 106 | 01101010 |
k | 107 | 01101011 |
l | 108 | 01101100 |
m | 109 | 01101101 |
n | 110 | 01101110 |
o | 111 | 01101111 |
p | 112 | 01110000 |
q | 113 | 01110001 |
r | 114 | 01110010 |
s | 115 | 01110011 |
t | 116 | 01110100 |
u | 117 | 01110101 |
v | 118 | 01110110 |
w | 119 | 01110111 |
x | 120 | 01111000 |
y | 121 | 01111001 |
z | 122 | 01111010 |
{ | 123 | 01111011 |
| | 124 | 01111100 |
} | 125 | 01111101 |
~ | 126 | 01111110 |
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
- JSON Formatter
- Base64 Encode / Decode
- URL Encoder / Decoder
- Unix Timestamp Converter
- Regex Tester
- UUID Generator (v4 / v7)
- Hash Generator (MD5 / SHA / HMAC)
- JWT Decoder
- Password Generator
- JSON ⇄ CSV Converter
- HTML Entity Encoder / Decoder
- Cron Expression Explainer
- Color Converter
- WCAG Contrast Checker
- All tools on one page (home)