Text to Binary

Convert text to binary code instantly. Free text to binary encoder.

Write each character as

Going the other way? Binary to Text

Rate this tool

How useful was this tool?

Text to Binary

Type or paste text into Text, or load the Example, and the binary appears under Binary as you type. Choose how each character is written:

  • UTF-8 bytes: 8 digits per byte, the form files and the web use. This is the default.
  • UTF-16 units: 16 digits per unit, the form JavaScript and Windows use internally.
  • Its code point: one number per character, as short as it can be.

Then choose what goes between the numbers (spaces, line breaks, commas or nothing), and whether to prefix each number with 0b. Stats show the characters, the bytes or units, and the binary digits. A table below breaks the text down character by character. Copy takes the result, and Clear starts over.

The conversion runs in your browser, so nothing you type is sent anywhere.

Example: “Hi é€😀”

Six characters, written three ways:

UTF-8 bytes: 12 bytes, 96 binary digits.

01001000 01101001 00100000 11000011 10101001 11100010 10000010 10101100 11110000 10011111 10011000 10000000

UTF-16 units: 7 units, 112 binary digits.

0000000001001000 0000000001101001 0000000000100000 0000000011101001 0010000010101100 1101100000111101 1101111000000000

Code points: one number per character, 63 digits in all.

01001000 01101001 00100000 11101001 10000010101100 11111011000000000

The character table shows the same text one row at a time:

Character Code point UTF-8 binary
H U+0048 01001000
i U+0069 01101001
space U+0020 00100000
é U+00E9 11000011 10101001
€ U+20AC 11100010 10000010 10101100
😀 U+1F600 11110000 10011111 10011000 10000000

Spaces, line breaks and tabs are named in the table rather than shown as blank cells.

Why the same text has different lengths

UTF-8 uses as few bytes as each character needs. Plain English letters, digits and punctuation take one byte. Accented letters, Greek, Cyrillic, Arabic and Hebrew take two. Chinese, Japanese and Korean take three, and emoji four. That’s why “Hi é€😀” is six characters but twelve bytes.

UTF-16 uses one 16-digit unit for almost every character, and two for emoji and other rare characters. Those two units are called a surrogate pair: 😀 becomes 1101100000111101 1101111000000000, the units D83D and DE00 in hex. That’s why "😀".length is 2 in JavaScript. It counts UTF-16 units, not characters.

Code points skip encoding altogether and write each character’s number in Unicode as binary. It’s at least eight digits, and longer when the number needs it: € (U+20AC) takes 14 digits, and 😀 (U+1F600) takes 17. This is the “pure” number, the one textbooks mean when they say a character “is” a number. But it isn’t how any file actually stores text.

Separators, and why “nothing” is risky

Spaces are the usual choice. Line breaks put one number per line, which is easy to read for short text. Commas, together with 0b, give a list you can paste straight into code: 0b01001000, 0b01101001 is a valid list of numbers in Python, JavaScript, Java and C++.

Nothing gives one unbroken string of 0s and 1s, and the tool warns about it. Only UTF-8 reads back cleanly that way, because a decoder can always cut an unbroken UTF-8 string into groups of eight.

  • UTF-16 needs groups of sixteen, which the decoder has to be told.
  • Code points have different lengths, so once the separators are gone, there’s no way to know where one character ends and the next begins.

If the binary is meant to be read back, keep a separator, or stick with UTF-8.

When it’s useful

  • Puzzles and messages. Write a binary clue for an escape room, a geocache, a puzzle hunt or a capture-the-flag challenge. Solvers can check it with Binary to Text.
  • Learning how text is stored. The three forms side by side show what “a character is a number” really means, and why UTF-8 took over the web.
  • Byte limits. Databases, APIs and protocols often limit a field in bytes, not characters. The stats tell you how many bytes a piece of text really takes. 100 characters of Chinese is about 300 bytes in UTF-8.
  • Debugging strings. When two strings look identical but don’t match, the binary shows the difference, such as a no-break space, a different apostrophe, or an accent stored as a separate character.

FAQ

How many bits does one character take?

In UTF-8, 8 bits for plain English, and 16, 24 or 32 bits for everything else. In UTF-16, 16 bits for nearly everything, and 32 for emoji. As a code point, as many bits as the number needs, at least 8 here.

Which form should I use?

UTF-8, unless you have a reason not to. It’s what files, web pages and most systems use, and what most binary-to-text converters expect. Use UTF-16 when you’re working with JavaScript strings or Windows text internals, and code points for teaching.

Does it handle emoji and other alphabets?

Yes. Every Unicode character works, including emoji, Chinese, Arabic and Cyrillic, in all three forms.

How do I turn binary back into text?

Use Binary to Text. It reads UTF-8, Latin-1 and UTF-16, with spaces, commas, 0b prefixes or no separators.

Note: All processing is done client-side. We do not store or see your data.

Contact

Missing something?

Feel free to request missing tools or give some feedback using our contact form.

Contact Us