FLXCode Text to Binary Converter

FLXCode apps

Appearance

Text to Binary Converter

Type text and get its bytes as 8-bit binary. Switch the direction to turn binary back into text.

Example

01001000 01100101 01101100 01101100 01101111

5 characters became 5 bytes.

Character by character

CharCode pointUTF-8 bytesSize
HU+0048010010001
eU+0065011001011
lU+006C011011001
lU+006C011011001
oU+006F011011111

How it works

  • Every character has a number (its Unicode code point). UTF-8 turns that number into 1 to 4 bytes.
  • This text has 5 characters and 5 bytes: plain ASCII uses one byte per character.
  • A byte is 8 bits. The top bit of an ASCII byte is always 0.

No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it.

Problem or idea? Email us

Worked examples

TextBinary (UTF-8 bytes)Note
A01000001Upper case A is 65, lower case a is 97: they differ by one bit
a01100001The 0x20 bit marks lower case
Hi!01001000 01101001 00100001Three characters, three bytes
é11000011 10101001One character, two bytes in UTF-8
€11100010 10000010 10101100Three bytes
😀11110000 10011111 10011000 10000000Four bytes for an emoji

The same Hello in hex is 48 65 6C 6C 6F. And 01010100 01101000 ... decodes to The one.

How UTF-8 packs a character

BytesPatternRange
10xxxxxxxU+0000 to U+007F (ASCII)
2110xxxxx 10xxxxxxU+0080 to U+07FF
31110xxxx 10xxxxxx 10xxxxxxU+0800 to U+FFFF
411110xxx 10xxxxxx 10xxxxxx 10xxxxxxU+10000 to U+10FFFF

The x bits hold the character's number. The leading bits of each byte tell a reader how many bytes belong together.

The number of any single byte can be read in other bases with the number base converter. To count how many characters your text has before you encode it, try the character counter, and the case converter changes upper and lower case, which is the one bit in the table above.

Numbers this uses

  • Encoding: UTF-8 (the browser's TextEncoder), the encoding of most web pages and files today.
  • Binary uses 8 bits per byte with leading zeros. Hex uses 2 digits, octal 3, decimal 0 to 255.
  • Limit: 5,000 characters in, 5,000 bytes in the other direction.
  • Bytes that are not valid UTF-8 are refused, not replaced with a question mark.

Nothing you type is uploaded. We count events without cookies (details).

FAQ

How do I convert text to binary?

Turn each character into its number, then write the number as 8 bits. H is 72 and 72 in binary is 01001000. The tool does this for the whole text at once and puts a space between the bytes. Pick hex, decimal or octal if you need the bytes in another form.

What is UTF-8 and why does é take two bytes?

UTF-8 is the usual way to store Unicode text. The 128 ASCII characters use one byte. Letters like é, ü or ж use two bytes, characters like € or 中 use three, and emoji use four. So the number of bytes can be larger than the number of characters, and the tool shows both.

Can I turn binary back into text?

Yes. Switch Direction to Binary to text and paste the bytes. Groups of 8 bits separated by spaces, or one long string whose length is a multiple of 8, both work. The tool decodes them as UTF-8. In decimal, hex and octal mode it reads bytes in that form instead.

Why does it say my bytes are not valid UTF-8?

UTF-8 has rules. A byte that starts with 110 must be followed by one continuation byte that starts with 10, 1110 by two, 11110 by three. If a byte is missing, cut off or from another encoding such as Latin-1, the text can not be read, so the tool refuses to guess and shows an error.

Is this the same as ASCII?

For the English letters, digits and punctuation, yes: the bytes are identical. ASCII only has 128 characters, one byte each with the top bit 0. UTF-8 keeps those bytes and adds the other characters on top, which is why plain English text looks the same in both.

Is there a limit on length?

Up to 5,000 characters or bytes at a time. The table below the result lists the first 40 characters, with their code points and bytes. The result box has all of the bytes and the copy button copies all of them.

What do spaces and new lines turn into?

A space is the byte 00100000 (32) and a new line is 00001010 (10). They are characters like any other, so they appear in the output. A tab is 00001001 (9).

Is my text saved or sent anywhere?

No. The text is converted in your browser. What you type is not put in the address bar, not stored and not counted. We only count whether you converted text to bytes or bytes to text.

More from FLXCode

Share Text to Binary Converter