Skip to content
NeedToConvert

Text to Binary

See the ones and zeros behind any text, or decode a binary message back into words.

  • Free
  • Private
  • No sign-up
Runs on your device. Nothing you enter is uploaded.

Every letter you type is stored as a number, and every number is stored as bits. A binary translator makes that visible: Hi becomes 01001000 01101001. It is a classic first exercise in computer science classes, a popular way to hide a message in a puzzle or a T-shirt design, and a practical debugging aid when you need to know exactly which bytes a string contains.

Type text to see it as binary, hexadecimal, octal or decimal bytes, or switch the direction and paste numbers to turn them back into text. Because the tool encodes text as UTF-8, accented letters, Arabic, Chinese and emoji all translate correctly in both directions. The conversion is done locally in your browser.

How text becomes binary

Computers store text using a character encoding, a rule that maps each character to one or more bytes. Today almost everything uses UTF-8. For the 128 basic ASCII characters, such as English letters, digits and common punctuation, UTF-8 uses one byte, identical to ASCII: capital H is 72, which is 01001000 in binary, 48 in hexadecimal and 110 in octal. Other characters take two to four bytes. The letter é is two bytes, 11000011 10101001, most Arabic letters are two bytes, and the grinning face emoji is four bytes, f0 9f 98 80 in hex.

Each byte is eight bits, so in binary every byte is written as exactly eight digits with leading zeros. Hexadecimal writes a byte as two digits from 00 to ff, octal as three digits from 000 to 377, and decimal as a plain number from 0 to 255. They are four ways of writing the same bytes.

Reasons to translate text to binary

Learning how computers store text

Students can type their name and see each letter's byte, then try an accented letter or an emoji to see why UTF-8 needs more than one byte for some characters.

Puzzles, games and secret messages

Escape rooms, geocaches, CTF challenges and birthday cards often hide a message in binary or hex. Paste the digits with Code to text selected to read it, or encode your own.

Debugging encoding problems

When text shows up as é or with odd invisible characters, the hex bytes reveal what is really there, such as a non-breaking space (c2 a0) or a zero-width space (e2 80 8b).

Creative and design projects

Binary versions of names, dates or short phrases are used in jewellery engravings, tattoos, posters and code-themed gifts. The spaced eight-digit groups are easy to read and reproduce.

Encoding and decoding options

Direction switches between Text to code and Code to text; changing it clears the input so you can paste the other kind of content. Number system picks Binary, Hex, Octal or Decimal for both directions. In the Text to code direction, each byte is written in the chosen base, separated by single spaces, and hex uses lower-case letters.

In the Code to text direction the decoder is forgiving about format. Bytes can be separated by spaces, line breaks, commas, semicolons or vertical bars, and prefixes like 0b, 0x and 0o are ignored. Binary, hex and octal can also be pasted as one unbroken string, such as 0100100001101001, as long as its length is a whole number of bytes. Each value must fit in a byte, so decimal numbers above 255 are rejected with a message naming the value. If the bytes are valid numbers but do not form valid UTF-8, a second message explains that instead of showing garbled text.

The Bytes counter shows how many UTF-8 bytes the text uses. Copy the result or download it as a text file.

How to use this tool

  1. Choose a Direction: Text to code to encode, or Code to text to decode.
  2. Pick the Number system: Binary, Hex, Octal or Decimal.
  3. Type or paste your text, or the numbers to decode, into the input box.
  4. Read the result in the output pane and check the Bytes count.
  5. Copy the output or download it as a .txt file.

Limitations

  • The tool always uses UTF-8. Binary made from another encoding, such as UTF-16 or Windows-1252, decodes incorrectly or fails for anything beyond basic ASCII.
  • Values are read as whole bytes. Seven-bit ASCII written without leading zeros works when separated by spaces, but an unbroken string must be a multiple of eight bits.
  • Encoded output is always separated by spaces. Use a find-and-replace afterwards if you need a different separator or no separator at all.
  • This is an encoding, not encryption. Anyone with a binary translator can read the message.

Frequently asked questions

How do I convert text to binary?

Leave Direction on Text to code and Number system on Binary, then type your text. Each character's UTF-8 bytes appear as eight-digit groups, for example A becomes 01000001.

How do I translate binary back to text?

Choose Code to text and Binary, then paste the binary. Groups of eight digits separated by spaces work best, but an unbroken string whose length is a multiple of eight is split automatically.

What is hello in binary?

In UTF-8 or ASCII, hello is 01101000 01100101 01101100 01101100 01101111. Each letter is one byte because all five are basic ASCII characters.

What does the error about valid UTF-8 mean?

Your numbers are valid bytes, but the sequence is not legal UTF-8, often because a byte is missing or the message was encoded with a different character set. Check that nothing was lost when copying.