My Tool Studio
Text

Text to Binary Converter

Type a word and this converter turns text to binary as you type, writing each byte as eight 0s and 1s. It uses UTF-8 by default, so A becomes 01000001, é becomes two bytes and an emoji becomes four, and you can switch to ASCII, UTF-16, Windows-1252 or Latin-1. The same tool converts text to decimal, hex or octal bytes. To decode, paste bytes separated by spaces, commas or new lines, or one unbroken run. A table shows each character's code point with its decimal, hex and binary bytes. Open a .txt file, then save the result as text or as a raw .bin file. Teachers use it to explain how computers store letters, and students use it to write their name in binary.

Always freeNo sign upRuns in your browser

How to use

01

Pick a direction

Pick Binary, Decimal, Hexadecimal or Octal in Number base and a Character encoding, then press Text to Binary or Binary to Text. Try sample loads Hi!, and Swap sends the output back as new input.

02

Type or paste your input

Type, paste, press Open .txt or drop a file. The output updates as you type. When encoding, choose a Byte separator, including a custom one, and tick Add 0b prefix if you want it. When decoding, any separator or prefix is accepted.

03

Check the breakdown and copy

The Character breakdown table lists each character's code point and its bytes in decimal, hex and binary. Click Copy, Save .txt, or Save .bin to download the raw bytes.

Why Text to Binary Converter

Letters in binary: A to Z and a to z

Each letter below is one byte in both ASCII and UTF-8. Uppercase and lowercase letters differ only in the third bit from the left: 010 for capitals and 011 for small letters. The last five bits give the letter's position in the alphabet, so A and a both end in 00001 and Z and z both end in 11010. That pattern makes it easy to read letters in binary once you know it.

LetterDecimalBinaryLetterDecimalBinary
A6501000001a9701100001
B6601000010b9801100010
C6701000011c9901100011
D6801000100d10001100100
E6901000101e10101100101
F7001000110f10201100110
G7101000111g10301100111
H7201001000h10401101000
I7301001001i10501101001
J7401001010j10601101010
K7501001011k10701101011
L7601001100l10801101100
M7701001101m10901101101
N7801001110n11001101110
O7901001111o11101101111
P8001010000p11201110000
Q8101010001q11301110001
R8201010010r11401110010
S8301010011s11501110011
T8401010100t11601110100
U8501010101u11701110101
V8601010110v11801110110
W8701010111w11901110111
X8801011000x12001111000
Y8901011001y12101111001
Z9001011010z12201111010

Digits, space and punctuation in binary

Digits run from 48 to 57, so the last four bits of each digit are the digit itself in binary: 5 is 0011 0101. The space character is 32, which is why sentences in binary have so many bytes starting with 0010.

CharacterDecimalBinary
04800110000
14900110001
25000110010
35100110011
45200110100
55300110101
65400110110
75500110111
85600111000
95700111001
Space3200100000
!3300100001
'3900100111
,4400101100
-4500101101
.4600101110
?6300111111
@6401000000

Worked example: converting Hi to binary by hand

Start with each character's code. H is 72 and i is 105. To write 72 in binary, subtract the largest power of two that fits and repeat: 72 is 64 plus 8, so bits 64 and 8 are on. Written across the eight places 128, 64, 32, 16, 8, 4, 2, 1, that gives 01001000.

Do the same for 105: 64 plus 32 plus 8 plus 1, which gives 01101001. Put them together with a space and Hi in binary is 01001000 01101001.

To check your work, click Binary to Text, paste your answer and see whether Hi comes back. If one bit is wrong you will get a different letter, which makes it easy to find the mistake. The Character breakdown table under the panes shows the same working for any text you type.

Common questions

How do you write your name in binary?
Type your name in Text to Binary mode and read the output. Each letter becomes one byte: Sam becomes 01010011 01100001 01101101. Capital and small letters differ by one bit, so check the case of each letter.
What is hello in binary?
In lowercase, hello is 01101000 01100101 01101100 01101100 01101111. The two l letters are the same byte, 01101100. Hello with a capital H starts with 01001000 instead.
How many bits are in one letter?
English letters, digits and common punctuation use 8 bits, which is one byte, because UTF-8 stores them exactly like ASCII. Accented letters such as é, and Greek, Cyrillic, Arabic and Urdu letters, use 16 bits. Hindi and Chinese characters use 24, and emoji use 32.
Can binary represent emojis?
Yes. In UTF-8 most emoji take four bytes. The grinning face emoji is 11110000 10011111 10011000 10000000. Paste an emoji in Text to Binary mode and the Character breakdown shows all four bytes.
How do I convert binary back to text?
Click Binary to Text and paste your bits. Groups can be separated by spaces, commas or new lines, or you can paste one long run and the tool splits it every 8 bits. The bytes are decoded as UTF-8, so multi-byte characters come back correctly.
Does this text to binary converter use ASCII or UTF-8?
UTF-8 by default. For English letters, digits and basic punctuation the result is identical to ASCII, one byte each, and other characters use two to four bytes. You can switch Character encoding to ASCII, UTF-16 BE or LE, Windows-1252 or Latin-1. Characters an encoding cannot store are written as ? and listed under the panes.
Why do I get an error when decoding binary to text?
The message tells you what is wrong. Common causes are a letter O instead of a zero, a group bigger than one byte, a Number base that does not match your input, or an unbroken run whose length is not a multiple of 8. If the bytes are not valid UTF-8, the tool reads each byte as one Latin-1 character and says so.
Why is the letter A 01000001 in binary?
Capital A has the character code 65. Written in base 2, 65 is 1000001, and padding it to 8 bits gives 01000001. Lowercase a is 97, or 01100001, so the case of a letter changes exactly one bit.
Can I get binary output without spaces?
Yes. Set Byte separator to None for one continuous string of bits, or choose Comma, New line or Custom. The decoder accepts all of these formats, including the unbroken one.
Can this tool convert text to hex or decimal as well as binary?
Yes. Change Number base to Hexadecimal, Decimal or Octal and the same text is written as bytes in that base, for example Hi! becomes 48 69 21 in hex and 72 105 33 in decimal. Decoding works the same way, so you can paste hex bytes, with or without 0x, and get text back.

More Text tools

View all