How it works
The Basics: Text and Binary
Computers don’t understand letters, numbers, or symbols directly. Instead, they represent all data using binary code – a series of 0s and 1s. This is because computers are built using electronic circuits that can only be in one of two states: on (1) or off (0).
Character Encoding
To convert text to binary, we use character encoding standards that map each character to a unique number:
| Encoding |
Bits per Character |
Character Range |
Example |
| ASCII |
7 (stored as 8) |
Basic English characters |
'A' → 65 → 01000001 |
| UTF-8 |
8-32 |
All Unicode (emojis, international) |
'€' → 226 → 11100010 10000010 10000000 |
| UTF-16 |
16 |
All Unicode |
'A' → 65 → 00000000 01000001 |
The Conversion Process
Text to Binary
- Get Character Code – For each character, find its numeric value (e.g.,
'A' = 65 in ASCII).
- Convert to Binary – Convert the number to binary (e.g.,
65 → 01000001).
- Apply Formatting –
- Add a prefix (e.g.,
0b).
- Pad with leading zeros to 8 or 16 bits.
- Add a separator (space, comma, dash, or custom).
- Combine Results – Join all binary values with your chosen separator.
Binary to Text
- Split Binary String – Divide the input by the separator.
- Remove Prefix – Strip any prefix (e.g.,
0b).
- Convert to Decimal – Convert each binary string to decimal (e.g.,
01000001 → 65).
- Map to Character – Find the character for each decimal value (e.g.,
65 → 'A').
- Combine Results – Join all characters to form the final text.
Bit Length & Separators
| Bit Length | Use Case | Example |
| ---------------- | --------------------------- | --------------------------- | --------- |
| 8-bit | ASCII (0-255) | 01000001 (A) |
| 16-bit | UTF-16 (Unicode) | 00000000 01000001 (A) |
| Separator |
Best For |
Example |
| Space |
Human readability |
01000001 01000010 |
| Comma |
Spreadsheets, CSV |
01000001,01000010 |
| Dash |
URLs, filenames |
01000001-01000010 |
| None |
Compact output |
0100000101000010 |
| Custom |
Special formatting needs |
`01000001 |
Practical Example
Input Text: Hi
Encoding: ASCII
Bit Length: 8
Separator: Space
Prefix: 0b
Leading Zeros: Yes
Conversion Steps:
'H' → 72 → 01001000 → 0b01001000
'i' → 105 → 01101001 → 0b01101001
- Output:
0b01001000 0b01101001