Binary Translator

Convert text to binary (8-bit UTF-8 bytes) or decode binary back to text. You can also show the same bytes as hexadecimal, decimal or octal, and choose a space, comma or no separator. Everything runs in your browser.

Byte-by-byte breakdown

How text becomes binary

Computers store text as numbers. This translator uses UTF-8, the encoding used by almost all web pages: every character is turned into one to four bytes, and each byte is written as eight bits (binary digits). A bit is 0 or 1, and the eight positions are worth 128, 64, 32, 16, 8, 4, 2 and 1. Adding the positions that hold a 1 gives the byte value — 01000001 is 64 + 1 = 65, the letter A.

Decoding works in reverse: the binary is split into groups of eight, each group becomes a byte, and the bytes are read as UTF-8 text.

How to convert text to binary step by step

Here is the word Cat converted by hand.

  1. Find each character's code. In ASCII (and UTF-8, which matches ASCII for these characters) C is 67, a is 97 and t is 116. Upper and lower case have different codes.
  2. Write each number as a sum of powers of two. The eight bit positions are worth 128, 64, 32, 16, 8, 4, 2 and 1. 67 = 64 + 2 + 1. 97 = 64 + 32 + 1. 116 = 64 + 32 + 16 + 4.
  3. Put a 1 in each used position and 0 elsewhere. 67 becomes 01000011, 97 becomes 01100001 and 116 becomes 01110100. Always keep eight digits, adding leading zeros.
  4. Join the bytes. Cat = 01000011 01100001 01110100. The same bytes are 43 61 74 in hexadecimal, 67 97 116 in decimal and 103 141 164 in octal.
CharacterDecimalBinaryHexOctal
C670100001143103
a970110000161141
t1160111010074164

To decode binary to text, do the same in reverse: split the digits into groups of eight, add up the position values of each 1 to get a number, and look the number up in the table below.

C = 01000011012816403201608041211place values · 64 + 2 + 1 = 67 = "C" in UTF-8/ASCII
Each of the 8 bits has a place value; add the values under every 1 to get the character code (C is 64 + 2 + 1 = 67).

Hex, decimal and octal output

Binary, hexadecimal, decimal and octal are just different ways of writing the same byte values. Hexadecimal (base 16) uses two digits per byte, 00 to FF, and is common in programming and network tools. Decimal shows each byte as a number from 0 to 255. Octal (base 8) uses three digits per byte, 000 to 377. Pick the format with the Output format menu, and the separator menu to put a space, a comma or nothing between bytes.

Examples to try

Common mistakes

Binary table for common characters

CharacterDecimalBinary
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)3200100000
!3300100001
?6300111111
.4600101110

What is ASCII?

ASCII is the original 7-bit character code for English text: 128 codes for letters, digits, punctuation and control characters. Printable characters are codes 32 to 126. UTF-8, which this translator uses, encodes these characters with the same single byte, so for plain English text ASCII and UTF-8 binary are identical. Letters outside ASCII, such as é or emoji, take two to four bytes in UTF-8.

Printable ASCII table (32–126) in binary
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

Binary to text (decoding)

  1. Split the binary into groups of 8 bits (one byte each).
  2. Convert each byte to a number: 01001000 = 72 and 01101001 = 105.
  3. Look the numbers up in the ASCII table above (or decode as UTF-8 for other characters): 72 is H and 105 is i.

So 01001000 01101001 decodes to Hi. Paste binary into the translator above and it does this for you, and tells you if the length is not a multiple of 8 bits or the bytes are not valid text.

Frequently asked questions

How to write "I love you" in binary code?

In 8-bit ASCII/UTF-8, "I love you" is 01001001 00100000 01101100 01101111 01110110 01100101 00100000 01111001 01101111 01110101. Each group of 8 bits is one character, and 00100000 is the space.

What does 666 mean in binary?

It depends on whether you mean the number or the text. The number 666 is 1010011010 in binary. The text "666" (three digit characters) is 00110110 00110110 00110110.

Can I convert text to binary?

Yes. Type or paste text into the translator above and it shows each character as 8-bit binary bytes, using UTF-8 so any language and emoji work.

What is 11111111 in binary code?

11111111 is the largest 8-bit value: 255 in decimal (FF in hexadecimal). On its own it is not a valid UTF-8 text byte, so it does not decode to a character.

How do you convert a letter to binary?

Each character is first turned into one or more bytes using UTF-8. Each byte is a number from 0 to 255, written as eight binary digits. For example, the letter A is byte 65, which is 01000001.

Why does an emoji become several bytes?

UTF-8 uses one byte for basic English letters, digits and punctuation, and two to four bytes for other characters. Most emoji need four bytes, so they appear as four 8-digit groups.

Do I need spaces between bytes when decoding?

No. You can paste groups separated by spaces, line breaks or commas, or one long string of 0s and 1s. The length must be a multiple of 8.

What is the difference between ASCII and UTF-8?

ASCII defines 128 characters. UTF-8 is a superset: the first 128 characters are encoded exactly like ASCII, and it can also encode every other Unicode character.

What happens if my binary is invalid?

The translator tells you if the input contains characters other than 0, 1, spaces and commas, if the length is not a multiple of 8, or if the bytes are not valid UTF-8.

Why do I get a 'not a multiple of 8' error?

Each byte is exactly eight bits, so the total number of 0s and 1s must divide evenly by 8. The error usually means a digit is missing or extra, or leading zeros were dropped (for example 1000001 instead of 01000001). The message shows how many bits were found.

Is my text uploaded anywhere?

No. The conversion runs entirely in your browser with JavaScript. Your text is not sent to a server or stored.

How do I convert binary to decimal?

Add the values of the positions that contain a 1. For an 8-bit byte the positions are worth 128, 64, 32, 16, 8, 4, 2 and 1, so 01100001 is 64 + 32 + 1 = 97. Choose Decimal in the Output format menu to see the decimal value of every byte of your text.