Cipher Utility

Text to Binary Converter

E-06

Type text and get its binary code, 8 digits per byte. Have binary to read? Use the Binary Translator. Runs in your browser; nothing is sent anywhere.

Bits:
Gap:
Prefix:

Byte breakdown

Each character with its bytes in decimal, hexadecimal and binary. Select a column to mark it.
Char
Dec
Hex
Bin

How to write a letter in binary

  1. Find the character code.
    A is 65.
  2. Write the place values 128 to 1.
  3. Take the largest value that fits and mark it 1.
  4. Repeat with what is left.
  5. Fill the other places with 0.

Worked example

A = 65 = ?

65 is 64 plus 1:

64  +  1  =  65

A = 01000001

Cipher Utility reference card Catalog no. E-06

How text becomes binary

Every character has a number, its character code. Capital H is 72, lowercase i is 105 and a space is 32. Codes up to 127 fit in one byte, so the encoder writes each one in base 2, padded to 8 digits so that every byte has the same width. Codes above 127 take two to four bytes (see accented letters below).

H → 72 → 01001000 i → 105 → 01101001 ! → 33 → 00100001

The byte breakdown under the fields shows the same steps for your own text. Move the cursor through either field, or click a column, and the matching character is ringed.

Text to binary table

Codes and binary for the characters people look up most often:

CharacterCodeBinary
A6501000001
B6601000010
Z9001011010
a9701100001
z12201111010
04800110000
95700111001
Space3200100000
!3300100001
.4600101110

Letters run in order, so B is one more than A and C one more than B. Digits work the same way: the digit 0 is code 48, not the number 0.

Uppercase and lowercase

Each lowercase letter is exactly 32 more than its capital. In binary that is a single bit: A is 01000001 and a is 01100001. Only the third digit from the left changes.

7-bit or 8-bit binary

Plain English letters, digits and punctuation fit in 7 bits, because the original ASCII codes only go up to 127. Some textbooks and puzzles use 7-bit groups for that reason. Most of the time you want 8-bit groups, which match how computers store bytes.

Cat, 8-bit: 01000011 01100001 01110100 Cat, 7-bit: 1000011 1100001 1110100

The encoder writes 8-bit groups unless you choose 7. Curly quotes, accented letters and emoji do not fit in 7 bits. If your text has one, the output stays in 8-bit bytes and a note names the character.

Accented letters and emoji

Characters outside plain English, such as é, ł or an emoji, take more than one byte in UTF-8, the encoding used on the web. The encoder writes all of their bytes, so é becomes two groups:

é → C3 A9 → 11000011 10101001

Binary back to text

To read binary as text, open the Binary Translator. It also works out whether the groups are 7 or 8 bits long. If you need the bytes in a shorter form, the hex converter writes the same bytes with two characters each.

Questions about text to binary

How do I convert text to binary?

Type the text into the encoder above. Each character is replaced by its character code (A is 65, a space is 32), and each byte of that code is written as 8 binary digits. Letters, digits and punctuation take one byte. Accented letters and emoji take two to four bytes in UTF-8. By hand, you look up the code and break it into the place values 128, 64, 32, 16, 8, 4, 2 and 1.

What is "hello" in binary?

01101000 01100101 01101100 01101100 01101111. Each group is one letter: h is 104, e is 101, l is 108 and o is 111.

Why does every letter take 8 digits?

Computers store text in bytes, and a byte is 8 bits. Plain English letters only need 7 bits, so their first digit is always 0 in 8-bit form. Switch Bits to 7 if you need the shorter 7-bit groups.

Why are uppercase and lowercase letters different in binary?

They have different character codes. A is 65 (01000001) and a is 97 (01100001). The two differ in one bit, the one worth 32, and that is true for every letter of the alphabet.

How do I turn binary back into text?

Paste it into the Binary Translator. It reads binary back into text and works out whether the groups are 7 or 8 bits long.

Is my text sent to a server?

No. The conversion runs in your browser with JavaScript, and nothing you type leaves your device.