Codec lesson · Binary UTF-8

Binary: see the bytes behind your text

Encode Keyboard represents every UTF-8 byte as eight zeroes and ones. That means English, Vietnamese, and emoji all work — but one visible character may use several bytes.

App profile · UTF-8 Round trip: Exact for valid UTF-8 text and complete 8-bit input.
Learning objective

Encode Keyboard represents every UTF-8 byte as eight zeroes and ones. That means English, Vietnamese, and emoji all work — but one visible character may use several bytes.

Binary is a numeral representation. Encode Keyboard first turns text into UTF-8 bytes, then writes each byte as an 8-bit value. Spaces between bytes are for readability and are optional when decoding.

01

How Encode Keyboard handles it

1

Text becomes UTF-8

Every Unicode string is converted to its standard UTF-8 byte sequence.

2

Each byte becomes 8 bits

A byte from 0 to 255 is padded to exactly eight binary digits.

3

Decode validates the result

Only 0 and 1 are accepted, the bit count must divide by eight, and the bytes must form valid UTF-8 text.

02

Worked example

InputHi
Output01001000 01101001

H is byte 72 and i is byte 105; their 8-bit forms are shown above.

03

Good uses

  • Learning how text is stored as bytes
  • Sharing readable bit patterns
  • Checking UTF-8 byte boundaries
04

Validation and common errors

  • Binary output is much longer than the source
  • A single changed bit can invalidate or alter decoded text
  • It provides no secrecy
05

Practice in your browser

This uses the same documented rules as the app and runs only in this tab.

Binary UTF-8This uses the same documented rules as the app and runs only in this tab.
Result

This uses the same documented rules as the app and runs only in this tab.

06

Knowledge check

Why can one emoji produce several 8-bit groups?