EasyUnitConverter.com

Text To Binary Converter

Enter the text value to convert to binary or Binary to Text.

10
10
10
16

About Text To Binary Converter

Our free online text to binary converter tool provides instant and accurate conversion between text and binary formats.

How to Convert Text to Binary

  1. Take the text value
  2. Apply the conversion formula
  3. Get the binary result

ASCII Text to Hex, Binary Conversion Table

ASCII CharacterHexadecimalBinary
NUL0000000000
SOH0100000001
STX0200000010
ETX0300000011
EOT0400000100
ENQ0500000101
ACK0600000110
BEL0700000111
BS0800001000
HT0900001001
LF0A00001010
VT0B00001011
FF0C00001100
CR0D00001101
SO0E00001110
SI0F00001111
DLE1000010000
DC11100010001
DC21200010010
DC31300010011
DC41400010100
NAK1500010101
SYN1600010110
ETB1700010111
CAN1800011000
EM1900011001
SUB1A00011010
ESC1B00011011
FS1C00011100
GS1D00011101
RS1E00011110
US1F00011111
Space2000100000
!2100100001
"2200100010
#2300100011
$2400100100
%2500100101
&2600100110
'2700100111
(2800101000
)2900101001
*2A00101010
+2B00101011
,2C00101100
-2D00101101
.2E00101110
/2F00101111
03000110000
13100110001
23200110010
33300110011
43400110100
53500110101
63600110110
73700110111
83800111000
93900111001
:3A00111010
;3B00111011
<3C00111100
=3D00111101
>3E00111110
?3F00111111
@4001000000
A4101000001
B4201000010
C4301000011
D4401000100
E4501000101
F4601000110
G4701000111
H4801001000
I4901001001
J4A01001010
K4B01001011
L4C01001100
M4D01001101
N4E01001110
O4F01001111
P5001010000
Q5101010001
R5201010010
S5301010011
T5401010100
U5501010101
V5601010110
W5701010111
X5801011000
Y5901011001
Z5A01011010
[5B01011011
\5C01011100
]5D01011101
^5E01011110
_5F01011111
`6001100000
a6101100001
b6201100010
c6301100011
d6401100100
e6501100101
f6601100110
g6701100111
h6801101000
i6901101001
j6A01101010
k6B01101011
l6C01101100
m6D01101101
n6E01101110
o6F01101111
p7001110000
q7101110001
r7201110010
s7301110011
t7401110100
u7501110101
v7601110110
w7701110111
x7801111000
y7901111001
z7A01111010
{7B01111011
|7C01111100
}7D01111101
~7E01111110
DEL7F01111111

How to Convert Text to Binary (Encoding Text as Binary Data)

Text-to-binary conversion is what happens every time you save a file, send a message, or type on a keyboard. Each character is mapped to a numeric code and stored as binary. Understanding this process reveals how file sizes relate to text length, why some characters take more bytes than others, and how encoding errors produce garbled text.

  1. Determine the encoding (ASCII for English text, UTF-8 for international text).
  2. Look up each character's numeric code in the encoding table.
  3. Convert each code to binary: 8 bits for ASCII, 8-32 bits for UTF-8.
  4. Pad each byte with leading zeros to exactly 8 bits.
  5. Concatenate all binary bytes in sequence.
💡 Tip: For English text using only ASCII characters: file size in bytes = number of characters. A 1000-character English text file is exactly 1000 bytes (plus any line endings). Non-ASCII characters (emojis, accented letters) increase the byte count.

Text to Binary: Common Strings

Frequently converted text strings and their binary representations:

InputOutput
Hello01001000 01100101 01101100 01101100 01101111
OK01001111 01001011
Yes01011001 01100101 01110011
40400110100 00110000 00110100
true01110100 01110010 01110101 01100101
null01101110 01110101 01101100 01101100
test01110100 01100101 01110011 01110100
A B01000001 00100000 01000010
EOF01000101 01001111 01000110
STOP01010011 01010100 01001111 01010000

Solved Examples: Text to Binary

Question 1: Convert "Login" to binary for a protocol specification.

Solution:

L = 76 = 01001100

o = 111 = 01101111

g = 103 = 01100111

i = 105 = 01101001

n = 110 = 01101110

Answer: "Login" = 01001100 01101111 01100111 01101001 01101110 — 5 bytes, 40 bits.

Question 2: How is the number "3.14" stored as text in a file?

Solution:

3 = 51 = 00110011

. = 46 = 00101110

1 = 49 = 00110001

4 = 52 = 00110100

Answer: "3.14" as text = 00110011 00101110 00110001 00110100 — 4 bytes. Note: the float 3.14 in IEEE 754 uses 32 bits differently.

Question 3: Convert the URL path "/api" to binary.

Solution:

/ = 47 = 00101111

a = 97 = 01100001

p = 112 = 01110000

i = 105 = 01101001

Answer: "/api" = 00101111 01100001 01110000 01101001 — exactly how an HTTP request sends the URL path.

Practice: Text to Binary

Try solving these on your own to test your understanding:

  1. Convert "Hi" to binary. (Answer: 01001000 01101001)
  2. Convert "2024" to binary. (Answer: 00110010 00110000 00110010 00110100)
  3. Convert "OK!" to binary. (Answer: 01001111 01001011 00100001)
  4. Convert "a+b" to binary. (Answer: 01100001 00101011 01100010)
  5. How many bytes does the string "Hello World" take in ASCII? (Answer: 11 bytes)

Text Encoding Errors: Mojibake Explained

When text is encoded in one system (e.g., UTF-8) and decoded in another (e.g., Latin-1), the binary bytes are misinterpreted, producing garbled characters called "mojibake." For example, the € symbol in UTF-8 is E2 82 AC (3 bytes). If a Latin-1 decoder reads these bytes, it shows € instead. Understanding the text→binary→text pipeline helps diagnose these encoding mismatches in web apps, databases, and file transfers.

Binary vs. Text Mode in File I/O

Programming languages distinguish text mode (applies encoding/newline conversion) from binary mode (raw bytes). In Python: open("f", "r") reads text, open("f", "rb") reads raw binary. In text mode, "Hello\n" might read as 5+1=6 characters regardless of whether the file uses LF (Unix) or CRLF (Windows). In binary mode, you see the exact bytes: 48 65 6C 6C 6F 0A (Unix) or 48 65 6C 6C 6F 0D 0A (Windows).

Key Takeaways

  • Each ASCII character becomes exactly 8 bits (1 byte) of binary.
  • File size in bytes ≈ character count for pure ASCII text.
  • UTF-8 characters can take 1-4 bytes depending on the code point.
  • The string "123" (text) differs from the integer 123 (binary 01111011).
  • Encoding mismatches between text→binary→text cause mojibake errors.
  • Text mode vs. binary mode affects how line endings are handled.

Related Number System Converters: