Saved

Press the star next to a tool's name to save it.

All my tools

Text to Binary

Type any text, and this text to binary converter shows the 8-bit binary code for each byte. Switch to decode to translate binary back into readable text.

Binary needs whole groups of 8 digits.

Your text stays in your browser. Nothing is uploaded.

Result

Enter your text and press Convert.

A text to binary converter shows you how a computer stores your words. Every character on a screen is held as a pattern of 0s and 1s, and this text to binary converter reveals that pattern. Type any text and each byte appears as eight binary digits. You can also switch to Binary to text and translate a string of 0s and 1s back into readable words. It's a fun way to send a coded message, and a useful teaching aid for anyone who's learning about computers, encoding or programming. Accents and emoji are supported as well.

How to use the text to binary converter

  1. Choose Text to binary or Binary to text.
  2. Type or paste your input.
  3. Choose whether to separate the bytes with spaces.
  4. Press Convert and copy the result.

How it works

A binary code is the value of a data-encoding convention represented in a binary notation, usually a sequence of 0s and 1s. The converter works in two steps. First, each character is turned into one or more bytes using UTF-8. Next, each byte is written as a number in base 2, with leading zeros so that it's always eight digits long.

A worked example

Take the word Hi. In UTF-8, the capital H has the value 72 and the lowercase i has the value 105. In base 2, 72 is 1001000, which becomes 01001000 when padded to eight digits. And 105 is 1101001, which becomes 01101001. So Hi in binary is 01001000 01101001. To read it back, take each group of eight, work out its value, and find the matching character.

Common characters in binary

CharacterDecimalBinary
A6501000001
B6601000010
a9701100001
04800110000
Space3200100000
!3300100001

How to read a byte

Each position in a byte has a place value, doubling as you move to the left: 128, 64, 32, 16, 8, 4, 2 and 1. To find a byte's value, add the place values under each 1. For 01000001, the 64 and the 1 are switched on, and 64 + 1 is 65, which is the code for the capital letter A. It's a lot like reading an ordinary number, in which each place is ten times larger than the one next to it. The only difference here is that each place is two times larger.

Why accented letters take more space

UTF-8 is a character encoding standard that supports all valid Unicode code points, using one to four bytes for each. Characters with lower values, which tend to occur more frequently, are encoded with fewer bytes. Basic English letters take one byte, so they look exactly the same as they do in ASCII. The letter é takes two bytes, giving 11000011 10101001, and most emoji take four bytes. That's why an emoji produces a much longer run of binary than a letter does. Almost every webpage is now sent in UTF-8.

Why decoding sometimes fails

To turn binary back into text, the tool needs complete groups of eight digits, so any stray digit or missing zero will cause an error. Only 0s and 1s are allowed, along with spaces and commas between bytes. The bits also have to form valid UTF-8. A group like 11111111 isn't a valid UTF-8 byte, so the tool will tell you instead of showing a garbled symbol. If your binary came from a different encoding, it might not decode correctly here.

What can I use it for?

  • Learning: see how computers represent text.
  • Teaching: build a classroom activity about number systems.
  • Puzzles: hide a message for friends to decode.
  • Gifts: print a name in binary on a card or a T-shirt.
  • Debugging: inspect exactly which bytes make up a string.

Is binary a secret code?

Not really. Binary only changes how a message is written, and anyone with a converter like this one can read it, so don't use it for protecting anything private. If you need to keep a message secret, use real encryption with a strong password. Your text is handled in your browser here, and it isn't sent to our server.

Binary, decimal and hexadecimal

Binary isn't the only way of writing the values of bytes. People often use decimal, because it's familiar, or hexadecimal, because it's compact and maps neatly onto binary. A byte can be written as eight binary digits, as a decimal number from 0 to 255, or as two hexadecimal digits. The letter A, for example, is 01000001 in binary, 65 in decimal and 41 in hexadecimal. All three are simply different ways of writing the very same value, and programmers switch among them depending on what's easiest to read. If you'd like to explore those conversions in more detail, the tools linked below can help you to move between number systems.

Common mistakes

  • Dropping leading zeros. Each byte needs all eight digits.
  • Assuming one character is one byte. Accents and emoji need more.
  • Treating binary as encryption. It offers no real security.

Change bases with the binary to decimal converter, encode data with the Base64 encoder and decoder, and protect a message with Encrypt Text.

What next

Use this often? Add Text to Bina to your Home screen.

Frequently asked questions

How does the text to binary converter work?

It turns each character into UTF-8 bytes, and it writes each byte as eight binary digits.

What is Hi in binary?

It's 01001000 01101001.

Can it convert binary to text?

Yes. Choose Binary to text and paste your 0s and 1s in groups of 8.

Does it support emoji?

Yes. Emoji are encoded as UTF-8, usually in four bytes.

Is binary encryption?

No. Anyone can decode it, so it doesn't keep anything secret.

What went wrong?

We only receive the reason you pick, never what you typed into the tool.

Thanks for your feedback.

More Developer Tools