Binary Translator

Type in either box — it converts live both ways.

Hexadecimal

48 69

Decimal

72 105

How binary encodes text

Computers store text as numbers. Each character gets a number, called a code point (A is 65, a is 97, space is 32), and that number is written in binary: base 2, using only 0 and 1. A group of 8 binary digits (bits) is a byte, which can hold any value from 0 to 255.

Each bit position stands for a power of two. Reading a byte from left to right, the positions are worth 128, 64, 32, 16, 8, 4, 2 and 1. Add up the positions that hold a 1 and you get the number. For 01000001, only the 64 and the 1 are switched on, so 64 + 1 = 65, which is the letter A.

ASCII and UTF-8

ASCII, from 1963, defines 128 characters: English letters, digits, punctuation and control codes. Since 128 values fit in 7 bits, ASCII is a 7-bit code. Capital letters start at 65 and lowercase letters at 97, exactly 32 higher. That is why A (01000001) and a (01100001) differ in only one bit.

UTF-8 is the encoding used by almost every website today. Its first 128 values match ASCII exactly, so English text looks the same in both. Every other character, such as é, ß, 日 or an emoji, is stored as 2 to 4 bytes. Those bytes always start with 1, so they never get mixed up with plain ASCII.

ASCII table: letters and digits

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
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
04800110000
14900110001
25000110010
35100110011
45200110100
55300110101
65400110110
75500110111
85600111000
95700111001

Space is 32 (00100000), the full stop is 46 (00101110) and the question mark is 63 (00111111).

Worked examples

Text to binary: "Hi". H is 72 = 64 + 8, so it becomes 01001000. Lowercase i is 105 = 64 + 32 + 8 + 1, so it becomes 01101001. "Hi" in binary is 01001000 01101001, which is 48 69 in hex.

Binary to text: 01001111 01001011. The first byte has 64, 8, 4, 2 and 1 switched on, which adds up to 79, the letter O. The second has 64, 8, 2 and 1 switched on, which is 75, the letter K. The message is "OK".

A character outside ASCII: "é". Its code point is 233, which is too big for 7 bits. UTF-8 stores it as two bytes, 11000011 10101001 (C3 A9 in hex). The leading 110 means "a two-byte character starts here" and the leading 10 means "this byte continues it". An emoji such as 😀 takes four bytes: F0 9F 98 80.

If binary decodes to strange symbols, the bit grouping is usually off. Check that each group has exactly 8 digits, or switch between 7-bit and 8-bit mode.

Binary and Morse code

Morse code is also a two-symbol code, but its letters have different lengths and it relies on timing gaps, while binary uses fixed-size bytes. Try the Morse code translator to compare, or see the Morse alphabet.

Frequently asked questions