Binary Translator

Type text to see it as binary, 8 bits to a byte of UTF-8, or paste binary to read it back as text, with each byte checked.

Direction
For Binary to Text, paste bytes with or without spaces between them.
Between Bytes

Results

10 bytes for 9 characters

Bytes

01001000 01101001 00101100 00100000 01100011 01100001 01100110 11000011 10101001 00100001

UTF-8 uses 2 to 4 bytes for characters outside ASCII.

Bytes per Character

  1. H010010001 byte
  2. i011010011 byte
  3. ,001011001 byte
  4.  001000001 byte
  5. c011000111 byte
  6. a011000011 byte
  7. f011001101 byte
  8. é11000011 101010012 bytes
  9. !001000011 byte

How to Use the Binary Translator

  1. Keep Text to Binary picked under Direction and type your text. The bytes appear beside it, or under it on a phone, as you type.
  2. Under Write Bytes As, keep Binary or pick Hexadecimal, Decimal or Octal. Under Between Bytes, pick Space or No Space.
  3. To read binary, pick Binary to Text and paste the bytes. Spaces between bytes are optional, and the style picked under Write Bytes As is the one that is read.
  4. Check the Bytes per Character panel to see which bytes are part of each character. Press Copy Text to copy the result, or Use Output as Input to paste it back with the direction reversed.

Text to Binary Example With an Accented Letter

The example text is Hi, café!, nine characters. In UTF-8 it is 10 bytes:

01001000 01101001 00101100 00100000 01100011 01100001 01100110 11000011 10101001 00100001

The first byte, 01001000, is H, and 01101001 is i. The comma and the space are one byte each, and so are c, a and f. The é is two bytes, 11000011 10101001, because it is outside the 128 ASCII characters, and the last byte, 00100001, is the exclamation mark. With No Space the bytes have no gaps: 010010000110100100101100..., and either form pasted back with Binary to Text is Hi, café! again.

Bytes per Character in UTF-8

In UTF-8 a character is one to four bytes, depending on its number in Unicode, the code point. Characters from U+0000 to U+007F, the ASCII range, are one byte that starts with 0. Up to U+07FF they are two bytes, up to U+FFFF three, and up to U+10FFFF four. In every longer character the first byte starts with 110, 1110 or 11110 and each byte after it starts with 10.

CharacterCode PointBytesHexadecimalBinary
Capital AU+004110100000141
Small aU+006110110000161
Digit zeroU+003010011000030
SpaceU+002010010000020
é, e with acute accentU+00E9211000011 10101001C3 A9
Euro sign €U+20AC311100010 10000010 10101100E2 82 AC
Grinning face emojiU+1F600411110000 10011111 10011000 10000000F0 9F 98 80

So with one byte per character, the answers for accented letters and emoji are wrong: the text has more bytes than characters, and the bytes are only correct when read as UTF-8.

Number Bases for Bytes

The same bytes can be written in four styles. Hexadecimal has two digits from 0 to F per byte and is common in code and file viewers. In decimal each byte is a number from 0 to 255, so there is always a space between bytes. Octal has three digits from 0 to 7 per byte. This is the word Hi in each style:

StyleWith SpacesNo Spaces
Binary01001000 011010010100100001101001
Hexadecimal48 694869
Decimal72 10572 105
Octal110 151110151

Errors When Reading Binary

Pasted bytes are checked before they are read. A character that is not a digit of the chosen style, such as a 2 in binary, is named in the note. A run of digits with no spaces must be a whole number of bytes, so 0100100001101 is refused: it has 13 digits, and 13 is not a multiple of 8. A group shorter than 8 digits is read with zeros in front, so 1001000 1101001 is still Hi.

Bytes can also be complete but not valid UTF-8. In 01001000 11000011 00101000 the second byte is the first of a two-byte character, and the third byte does not start with 10, so the text is H�(. The replacement mark � is in place of the bad sequence, and the note has the position of the first bad byte.

How Text Is Converted to Binary and Back

For Text to Binary, the text is encoded as UTF-8, the encoding defined in RFC 3629, and each byte is written in the chosen style: binary with 8 digits, hexadecimal with 2, decimal without leading zeros, or octal with 3. Line breaks are bytes too, so a line break is 00001010.

For Binary to Text, spaces and commas count as separators between bytes. A group longer than one byte is read 8 digits at a time in binary, 2 in hexadecimal and 3 in octal. The bytes are then read as UTF-8. A byte that is never valid in UTF-8, such as 11111111, an incomplete sequence, an overlong form or a surrogate code point is replaced with �, the same as in browsers. The conversion is done in your browser.

FAQs

Q1. How Do You Convert Text to Binary?

You convert text to binary by encoding each character as UTF-8 bytes and writing every byte as 8 binary digits. Capital H is byte 72, which is 01001000, and small i is 105, which is 01101001, so Hi becomes 01001000 01101001. Type the text into the box and the bytes appear at once.

Q2. Why Does an Accented Letter Take Two Bytes in Binary?

An accented letter such as é takes two bytes because UTF-8 keeps one byte only for the 128 ASCII characters, and é is outside that range at U+00E9. Its bytes are 11000011 10101001. A euro sign takes three bytes and most emoji take four, so a binary string is often longer than the text it came from.

Q3. How Many Bits Are in a Byte?

A byte has 8 bits, so each byte of binary is written with 8 digits that are 0 or 1, from 00000000 for 0 to 11111111 for 255. That is why the translator splits binary pasted without spaces every 8 digits and refuses a run whose length is not a multiple of 8.

Q4. What Is the Difference Between ASCII and UTF-8 in Binary?

ASCII has 128 characters and uses 7 bits, usually written as one 8-bit byte, whereas UTF-8 covers every Unicode character with one to four bytes. For the ASCII characters the bytes are identical, so plain English text gives the same binary in both, and only other characters differ.

Q5. Why Does My Binary Decode to Strange Characters?

Binary decodes to strange characters when the bytes are not valid UTF-8 or were cut at the wrong places, for example when a digit is missing and every later byte is read one digit too early. Check the note under the result: it names the first bad byte, and the replacement mark � shows where the text could not be read.

Sources

RFC 3629, UTF-8, a transformation format of ISO 10646 (IETF, 2003), section 3. The Unicode Standard, code points U+0000 to U+10FFFF.