Text to Binary Converter - Binary, Hex, Octal, Decimal and Back

Type text and see the bytes behind it in binary, hexadecimal, octal or decimal, or paste bytes and read the text they spell.

About this tool

The conversion uses UTF-8, the encoding of almost every web page, so the letter A is one byte (01000001) and the letter é is two (11000011 10101001). Mistakes in pasted code are reported with their position instead of being quietly repaired. It all runs in your browser and nothing is sent anywhere.

How it works

How to read binary. A byte is eight bits, and each bit is worth a power of two: 128, 64, 32, 16, 8, 4, 2, 1 from left to right. Add up the places that hold a 1. The byte 01000001 has a 1 in the 64 place and the 1 place, so it is 65, which is the letter A. The two bytes 01001000 01101001 are 72 and 105, the letters H and i, so together they spell Hi. Hexadecimal writes the same byte with two digits (41 for 65; 48 69 for Hi), octal with up to three (101) and decimal as a number from 0 to 255.

From text to bytes. The text is cut into characters and each is stored in UTF-8, defined in RFC 3629. A character from U+0000 to U+007F takes one byte and is identical to ASCII. U+0080 to U+07FF takes two bytes, U+0800 to U+FFFF three, and U+10000 to U+10FFFF four. So the letter é (U+00E9) is C3 A9, the euro sign (U+20AC) is E2 82 AC, and the grinning face emoji (U+1F600) is F0 9F 98 80. This tool uses the browser's own TextEncoder, which always produces UTF-8, and lists the first 64 characters one by one so you can see which bytes belong to which character.

From bytes to text. Your groups are read as bytes and then checked against the well-formed UTF-8 sequences before any text is built. Separate the groups with spaces, commas, semicolons or line breaks; each may start with 0b, 0x or 0o. Without separators binary is read eight digits at a time, hexadecimal two and octal three, while decimal needs separators. A digit that does not belong, a group of the wrong length or a decimal over 255 is reported with its group number, line and column. Bytes that are not valid UTF-8, such as a lone C3, are reported with the byte position. They are never swapped for the replacement character, so a mistake cannot hide.

ASCII is the older 7-bit code of 128 values: 33 control codes and 95 printable characters, from the space (32) to the tilde (126). The table on this page lists all 95 in decimal, hexadecimal, octal and binary. Values 128 to 255 are not ASCII, and what they mean depends on the encoding (Latin-1 and Windows-1252 differ), so a byte in that range is accepted here only as part of a valid UTF-8 sequence.

Worked examples

The letter A

A is code 65. Since 65 = 64 + 1, the byte is 01000001 in binary, 41 in hexadecimal, 101 in octal and 65 in decimal. Lower-case a is 97, which is 01100001: the only change is the 32 place.

The word Hi

H is 72 (01001000) and i is 105 (01101001), so Hi is 01001000 01101001 in binary and 48 69 in hexadecimal. Paste either back in Code to text mode and you get Hi.

A letter with an accent

The letter é is U+00E9, which UTF-8 stores in two bytes: 11000011 10101001, or C3 A9 in hexadecimal. The first byte starts with 110 (a two-byte character) and the second with 10 (a continuation byte). A converter that gives one byte for é is using Latin-1, not UTF-8.

Finding a typo in pasted binary

In 01001000 01101002 the last digit is a 2. The tool says group 2 (line 1, column 17) has a character that is not a binary digit, and leaves the rest alone so you can fix just that digit.

Printable ASCII characters (32 to 126)

CharacterDecimalHexOctalBinary
space322004000100000
!332104100100001
"342204200100010
#352304300100011
$362404400100100
%372504500100101
&382604600100110
'392704700100111
(402805000101000
)412905100101001
*422A05200101010
+432B05300101011
,442C05400101100
-452D05500101101
.462E05600101110
/472F05700101111
0483006000110000
1493106100110001
2503206200110010
3513306300110011
4523406400110100
5533506500110101
6543606600110110
7553706700110111
8563807000111000
9573907100111001
:583A07200111010
;593B07300111011
<603C07400111100
=613D07500111101
>623E07600111110
?633F07700111111
@644010001000000
A654110101000001
B664210201000010
C674310301000011
D684410401000100
E694510501000101
F704610601000110
G714710701000111
H724811001001000
I734911101001001
J744A11201001010
K754B11301001011
L764C11401001100
M774D11501001101
N784E11601001110
O794F11701001111
P805012001010000
Q815112101010001
R825212201010010
S835312301010011
T845412401010100
U855512501010101
V865612601010110
W875712701010111
X885813001011000
Y895913101011001
Z905A13201011010
[915B13301011011
\925C13401011100
]935D13501011101
^945E13601011110
_955F13701011111
`966014001100000
a976114101100001
b986214201100010
c996314301100011
d1006414401100100
e1016514501100101
f1026614601100110
g1036714701100111
h1046815001101000
i1056915101101001
j1066A15201101010
k1076B15301101011
l1086C15401101100
m1096D15501101101
n1106E15601101110
o1116F15701101111
p1127016001110000
q1137116101110001
r1147216201110010
s1157316301110011
t1167416401110100
u1177516501110101
v1187616601110110
w1197716701110111
x1207817001111000
y1217917101111001
z1227A17201111010
{1237B17301111011
|1247C17401111100
}1257D17501111101
~1267E17601111110

Frequently asked questions

How do I convert text to binary?

Turn each character into its UTF-8 bytes, then write each byte as eight binary digits. For Hi the bytes are 72 and 105, which are 01001000 and 01101001. The converter does this as you type and lets you choose the separator, 4-bit grouping and a 0b prefix.

What is the binary code for the letter A?

Capital A is 01000001 (decimal 65, hexadecimal 41). Lower-case a is 01100001 (97, 61). Letters, digits and punctuation all have fixed codes; the table on this page lists the 95 printable ASCII characters.

Why does é turn into two bytes but e into one?

UTF-8 uses one byte for the 128 ASCII characters and more bytes for the rest of Unicode: two for accented Latin letters, Greek, Cyrillic, Hebrew and Arabic, three for most other scripts including Sinhala and Tamil, and four for characters above U+FFFF such as most emoji. The first byte tells a reader how many bytes follow.

Is this ASCII or Unicode?

Both, in the sense that matters. ASCII is the first 128 Unicode characters, and UTF-8 stores them as the same single bytes. Text that is plain English therefore gives the same bytes in ASCII and in UTF-8. The two differ only for characters outside ASCII.

How do I convert binary back to text?

Choose Code to text, pick Binary and paste the bytes with a space between each group of eight digits. Groups of four digits (0100 1000) are also understood and are joined in pairs. If a group has seven digits the tool shows you the padded version to use, for example 01000001 for 1000001.

What does it mean when the bytes are not valid UTF-8?

Some byte patterns can never appear in UTF-8: a continuation byte with no lead byte, a lead byte whose follower is missing, or the overlong forms C0 and C1. A common cause is text saved in Latin-1, where é is the single byte E9. In UTF-8 E9 starts a three-byte character, so it fails. The tool reports the byte position and keeps the bytes as they are.

Is my text uploaded anywhere?

No. The conversion runs in your browser with its built-in TextEncoder and TextDecoder, and nothing you type is sent to a server.

Updated Oct 13, 2026