# Text to binary: how characters become 0s and 1s

> How a character becomes a number and then a string of bits: ASCII, UTF-8 bytes for é, Chinese characters and emoji, how to convert by hand, worked examples and common mistakes.

- Tool: [Text to Binary Converter](https://toolsg.com/en/text-to-binary)
- Language: en (available: en, zh, ms, ta)
- Last verified against official sources: 2026-10-18
- Source site: ToolSG — a planning guide, not official or financial advice. Cite the agencies listed under Sources.

## Key figures at a glance

| Fact | Value | Source |
| --- | --- | --- |
| Bits per byte | 8 binary digits, zero-padded — A is 65, written 01000001. The tool always shows full 8-digit groups, separated by spaces. |  |
| What is encoded | The UTF-8 bytes of your text — Not the code points. The converter calls the browser's TextEncoder, which always produces UTF-8. | [MDN](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder) |
| Bytes per character | 1 to 4 — ASCII 1, é 2, most Chinese characters 3, emoji 4. | [RFC 3629](https://www.rfc-editor.org/rfc/rfc3629) |
| Where it runs | In your browser — The conversion is plain JavaScript on the page and updates as you type. |  |

## Converting text to binary by hand

This is exactly what the converter does for each byte.

1. **Find the character's number** (Step 1) — Look the character up in the ASCII table (A = 65, a = 97, 0 = 48, space = 32). Characters outside ASCII have a Unicode code point instead. Tools: [Text to ASCII Converter](https://toolsg.com/en/text-to-ascii)
2. **Turn non-ASCII characters into UTF-8 bytes** (Only for é, 中, emoji and so on) — Fit the code point into the UTF-8 bit pattern for its range. The result is 2, 3 or 4 bytes, each a number from 0 to 255.
3. **Write each byte in base 2** (Step 3) — Subtract the place values 128, 64, 32, 16, 8, 4, 2, 1 from the byte, writing 1 when a value fits. Pad on the left to 8 digits.
4. **Join the bytes with spaces** (Step 4) — Keep the bytes in order. Reading them back with the binary-to-text tool should return the original text. Tools: [Binary to Text Converter](https://toolsg.com/en/binary-to-text)

## From character to bits

A computer stores a character as a number, and a number as bits. Two steps are involved: a **character set** decides which number a character gets (`A` is 65), and an **encoding** decides how that number is written as bytes. For English letters, digits and punctuation, ASCII and UTF-8 agree: one byte per character, with the top bit 0. That is why `A` becomes `01000001`.

## Why é, Chinese and emoji take more than one byte

UTF-8 uses 1 to 4 bytes per character. The leading bits of the first byte say how long the sequence is, and every following byte starts with `10`.

| Code point range | Bytes | Bit pattern |
| --- | --- | --- |
| U+0000 to U+007F | 1 | 0xxxxxxx |
| U+0080 to U+07FF | 2 | 110xxxxx 10xxxxxx |
| U+0800 to U+FFFF | 3 | 1110xxxx 10xxxxxx 10xxxxxx |
| U+10000 to U+10FFFF | 4 | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx |

For 中 (U+4E2D, bits `0100 1110 0010 1101`) the 3-byte pattern gives `11100100 10111000 10101101`.

## Worked examples

These results come from the same code the converter runs.

| Text | UTF-8 bytes | Binary output |
| --- | --- | --- |
| A | 1 | 01000001 |
| Hi | 2 | 01001000 01101001 |
| é | 2 | 11000011 10101001 |
| 中 | 3 | 11100100 10111000 10101101 |
| 😀 | 4 | 11110000 10011111 10011000 10000000 |

> **Tip:** One character is not always one byte. A short Chinese word of three characters is nine bytes, which is 72 binary digits.

## Doing H by hand

`H` is 72. 72 − 64 = 8, and 8 − 8 = 0, so the bits for 64 and 8 are 1: `0 1 0 0 1 0 0 0`, which is `01001000`.

## Where binary text shows up

Binary is useful for teaching how data is stored, for puzzles and CTF challenges, for checking what a protocol or file format really contains, and for seeing why the same word takes a different number of bytes in different scripts. Real systems rarely store text as written-out 0s and 1s; the digits here are a readable picture of the bytes.

## Common mistakes

- **Assuming 7 bits.** Classic ASCII fits in 7 bits, but this tool shows 8-digit bytes, so `A` has a leading 0.
- **Mixing up code point and byte.** 中 is U+4E2D (20013), but its UTF-8 bytes are 228, 184 and 173.
- **Counting characters instead of bytes.** The output has one 8-digit group per byte, so a Chinese character gives three groups and an emoji gives four.
- **Expecting binary to be encrypted.** It is only another way of writing the same text.

## Related tools

- [Binary to text](https://toolsg.com/en/binary-to-text) — convert the bits back.
- [Text to hex](https://toolsg.com/en/text-to-hex) — the same bytes in base 16.
- [Text to ASCII](https://toolsg.com/en/text-to-ascii) — the same bytes in decimal.
- [Text to octal](https://toolsg.com/en/text-to-octal) — the same bytes in base 8.
- [Unicode explorer](https://toolsg.com/en/unicode-explorer) — look up code points.
- [Base64 encoder](https://toolsg.com/en/base64-encoder) — another way to write bytes as text.

## Frequently asked questions

**Is my data sent anywhere?**

No. The conversion runs entirely in your browser using JavaScript. Nothing you paste leaves your device, is logged, or is stored.

**How should I separate values?**

Spaces work, and so do commas, colons and semicolons. For binary, hex and octal you can also paste a single unbroken run of digits — it is split into bytes automatically.

**Does it handle emoji and non-English text?**

Yes. Text is treated as UTF-8, so accented characters, Chinese, Tamil and emoji all convert correctly. They simply take more than one byte each.

**Why did I get an error?**

The input contained a character that is not valid for the source format, a value above 255, or a run of digits that does not divide evenly into bytes. The message names the specific token so you can find it.


## Sources

- [RFC 3629 — UTF-8, a transformation format of ISO 10646](https://www.rfc-editor.org/rfc/rfc3629) — Byte patterns for 1 to 4 byte sequences.
- [RFC 20 — ASCII format for network interchange](https://www.rfc-editor.org/rfc/rfc20) — The 7-bit ASCII code.
- [MDN — TextEncoder](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder) — Encodes strings as UTF-8.
