FormatterHQ

Text to Binary

Translate text into binary code. Each UTF-8 byte is written as eight 0s and 1s, with your choice of separator.

Loading tool…
Ready.

How to use the Text to Binary

  1. Type or paste into the Text box, or click Sample. You can also drop a text file on either box, or load one into the Binary box with its Open file button.
  2. The Binary box updates live as you type. It works both ways — edit the Binary side to convert back, or click ⇄ Swap to exchange the sides.
  3. Adjust Separator in the options bar above the editors; the result refreshes immediately.
  4. Use Copy or Download on either box to take the result, or Clear to start again.

Text to binary, byte by byte

Binary is how computers store everything, including text. A text to binary conversion shows the bits behind each character: the tool encodes your text as UTF-8 and writes every byte as an 8-digit binary number, padded with leading zeros so each group has exactly eight bits.

Example

Input:

Hi there!

Output:

01001000 01101001 00100000 01110100 01101000 01100101 01110010 01100101 00100001

The letter H is 72 in decimal, which is 01001000 in binary: 64 + 8 = 72.

Reading a binary byte

Each position in a byte has a value, doubling from right to left:

Bit1286432168421
01001000 (H)01001000
01101001 (i)01101001

Add up the values where the bit is 1 and you get the character code: 64 + 32 + 8 + 1 = 105 for “i”.

Beyond ASCII

ASCII characters fit in one byte and always start with 0. Other characters use two to four bytes in UTF-8, and each of those bytes starts with 1. For example, “é” becomes 11000011 10101001. The leading 110 marks the start of a two-byte sequence and 10 marks a continuation byte — a neat way to see UTF-8’s structure.

Separator options

  • Space — the most readable form, one byte per group.
  • None — a continuous bit stream, handy for puzzles or bit-level exercises.
  • New line — one byte per line, easy to annotate or paste into a spreadsheet.

Text to binary in code

Python: ' '.join(f'{b:08b}' for b in 'Hi'.encode()). JavaScript: [...new TextEncoder().encode('Hi')].map(b => b.toString(2).padStart(8, '0')).join(' '). Both give the same result as this tool because they work on UTF-8 bytes.

Uses

Teaching how computers represent text, preparing puzzle or escape-room clues, creating binary-themed designs, and checking bit patterns in low-level programming. Binary is not encryption; anyone can translate it back.

Translate back with Binary to Text. For numbers rather than text, use Decimal to Binary, and for a per-character table with decimal, hex and binary, try Char to ASCII. The conversion runs in your browser.

How many bits does your text take?

Because the output shows every UTF-8 byte, you can read the storage size straight from it: count the groups and multiply by eight. “Hello” is 5 groups, or 40 bits. The count depends on the characters, not just their number:

CharacterUTF-8 bytesBinary
A101000001
é211000011 10101001
€311100010 10000010 10101100
😀411110000 10011111 10011000 10000000

JavaScript's charCodeAt works on UTF-16 instead and would describe the emoji as two 16-bit units, so its binary looks completely different. When results from a program disagree with this tool, check which encoding the program uses.

Frequently asked questions

How is “A” written in binary?
Capital A is 65, which is 01000001 in 8-bit binary. Lowercase a is 97, or 01100001.
Why does each character have 8 digits?
Each group is one byte, and a byte has 8 bits. Leading zeros are kept so every group has the same length and can be split reliably.
Why do some characters produce several bytes?
The tool uses UTF-8. Characters outside ASCII, such as é, Chinese characters or emoji, take two to four bytes.
Is binary code a form of encryption?
No. It is simply another way to write the same bytes and can be translated back instantly.

Last updated October 3, 2026

Related tools