belun.app Blog RU

Text to Binary: How ASCII Encoding Turns Characters into Bits

A practical guide to how computers store text as binary, how to read binary-encoded strings by hand, and when you'd actually need to do this.

Glowing green binary code on a dark monitor screen — ASCII text encoding

Every character you type has a number behind it. The letter ‘H’ is 72. ‘i’ is 105. A space is 32. These numbers come from ASCII — a standard finalized in 1963 that maps 128 characters to numeric codes and still underpins most of the text you work with today.

Binary is just how those numbers look in base 2. Instead of 72, you write 01001000. Each position is a power of 2: from right to left, the bits represent 1, 2, 4, 8, 16, 32, 64, 128. Add up the ones — 64 + 8 = 72. That’s ‘H’.

The ASCII table: 128 characters that run the web

ASCII covers codes 0–127. The first 32 are control characters: newline (10), tab (9), carriage return (13). Characters 32–126 are printable: letters, digits, punctuation, space. Character 127 is DEL — a relic from when it meant “punch all holes in this tape position.”

Ranges worth memorizing:

  • Digits ‘0’–‘9’: codes 48–57
  • Uppercase ‘A’–‘Z’: codes 65–90
  • Lowercase ‘a’–‘z’: codes 97–122

The gap of 32 between uppercase and lowercase is deliberate. Flipping case is just flipping bit 5 (the 32-position). ‘A’ is 01000001. ‘a’ is 01100001. One bit different.

Reading binary by hand

You won’t do this often, but it’s worth knowing once. Split into 8-bit groups and add powers of 2 for each set bit:

01001000 = 64 + 8 = 72 = 'H'
01100101 = 64 + 32 + 4 + 1 = 101 = 'e'
01101100 = 64 + 32 + 8 + 4 = 108 = 'l'
01101100 = 108 = 'l'
01101111 = 64 + 32 + 8 + 4 + 2 + 1 = 111 = 'o'

“Hello” — 5 characters, 40 bits.

When you’d actually need this

CTF competitions. Binary-encoded strings appear constantly in capture-the-flag challenges. They’re easy to spot — a long run of 0s and 1s in groups of 8.

Debugging binary file formats. Some formats use bit flags directly. If you’re parsing a TCP header or a network packet, being able to verify what a raw byte contains is useful. Text-to-binary is the quickest way to do that check.

Teaching how computers work. Converting “Hi” to binary and back is one of the clearest demonstrations of what a byte actually is. The abstraction disappears immediately.

Puzzle encoding. It’s not encryption — anyone with a decoder reads it in seconds — but binary looks opaque enough to casual observers that it works for puzzles and riddles.

What about Unicode?

ASCII handles 128 characters. Unicode handles over 140,000. The Text to Binary tool uses JavaScript’s charCodeAt, which returns UTF-16 code points. For standard ASCII characters (0–127) the result matches classic ASCII exactly. For anything outside that range — ‘é’ is 233, ’€’ is 8364, emoji are in the thousands — you get a value above 127, and the binary looks different from what a single-byte ASCII encoder would produce.

For most purposes — debugging, learning, simple encoding — this doesn’t matter. If you’re working with a specific byte-level protocol, check which encoding it expects before assuming.


Paste any string into the Text to Binary converter and the binary representation appears instantly. Works the other way too — paste binary and get text back.

Try the tool

Text to Binary →