Binary Code: How Computers Represent Numbers and Letters
Binary code is the agreement about what a group of 0s and 1s stands for: a character, a number or an instruction.
What is binary code?
Binary code is a way of writing data using only two symbols, 0 and 1. Each symbol is one bit; groups of bits stand for numbers, letters, or instructions that a computer can store and process.
Two symbols are enough because a circuit only has to tell two states apart, and telling two apart is far more reliable than telling ten apart. Everything above that — numbers, letters, pictures, sound — is a matter of agreeing what a group of bits stands for.
What do the 0 and 1 in binary code mean?
Each 0 or 1 is a bit: a switch that is off or on. A bit alone holds two values; 8 bits (one byte) hold 256 combinations, enough for every letter, digit and symbol in ASCII.
| Bits | Combinations | Largest value |
|---|---|---|
| 1 | 2 | 1 |
| 2 | 4 | 3 |
| 4 | 16 | 15 |
| 8 | 256 | 255 |
| 16 | 65536 | 65535 |
A byte is 8 bits and holds 256 values, 0–255; a nibble is 4 bits.
Each extra bit doubles the count, so width is the only thing that limits what a group can hold. how a bit, a nibble and a byte relate covers the units in depth.
How does binary code represent a letter?
A letter is stored as its character code written in 8 bits. The letter A has ASCII code 65, and 65 in binary is 01000001, so A in binary code is 01000001.
The same row answers in any base: 'A' is 65 in decimal, 41 in hex, 101 in octal and 01000001 in binary. This page shows one row; every ASCII code and its character carries all 128.
What is the binary alphabet (A–Z in binary)?
The binary alphabet is the list of 8-bit codes for A–Z (01000001 to 01011010) and a–z (01100001 to 01111010). Lowercase letters differ from uppercase by one bit, worth 32.
A is ASCII 65 = 0x41 = 0o101 = 0b01000001; a is 97 = 0x61 = 0o141 = 0b01100001. Uppercase and lowercase differ by 32, which is bit 5.
| Char | Dec | Binary |
|---|---|---|
| A | 65 | 01000001 |
| B | 66 | 01000010 |
| C | 67 | 01000011 |
| D | 68 | 01000100 |
| E | 69 | 01000101 |
| F | 70 | 01000110 |
| G | 71 | 01000111 |
| H | 72 | 01001000 |
| I | 73 | 01001001 |
| J | 74 | 01001010 |
| K | 75 | 01001011 |
| L | 76 | 01001100 |
| M | 77 | 01001101 |
| N | 78 | 01001110 |
| O | 79 | 01001111 |
| P | 80 | 01010000 |
| Q | 81 | 01010001 |
| R | 82 | 01010010 |
| S | 83 | 01010011 |
| T | 84 | 01010100 |
| U | 85 | 01010101 |
| V | 86 | 01010110 |
| W | 87 | 01010111 |
| X | 88 | 01011000 |
| Y | 89 | 01011001 |
| Z | 90 | 01011010 |
| a | 97 | 01100001 |
| b | 98 | 01100010 |
| c | 99 | 01100011 |
| d | 100 | 01100100 |
| e | 101 | 01100101 |
| f | 102 | 01100110 |
| g | 103 | 01100111 |
| h | 104 | 01101000 |
| i | 105 | 01101001 |
| j | 106 | 01101010 |
| k | 107 | 01101011 |
| l | 108 | 01101100 |
| m | 109 | 01101101 |
| n | 110 | 01101110 |
| o | 111 | 01101111 |
| p | 112 | 01110000 |
| q | 113 | 01110001 |
| r | 114 | 01110010 |
| s | 115 | 01110011 |
| t | 116 | 01110100 |
| u | 117 | 01110101 |
| v | 118 | 01110110 |
| w | 119 | 01110111 |
| x | 120 | 01111000 |
| y | 121 | 01111001 |
| z | 122 | 01111010 |
| 0 | 48 | 00110000 |
| 1 | 49 | 00110001 |
| 2 | 50 | 00110010 |
| 3 | 51 | 00110011 |
| 4 | 52 | 00110100 |
| 5 | 53 | 00110101 |
| 6 | 54 | 00110110 |
| 7 | 55 | 00110111 |
| 8 | 56 | 00111000 |
| 9 | 57 | 00111001 |
| (space) | 32 | 00100000 |
How do you write words in binary code?
Write each character's 8-bit code in order and separate the bytes with spaces: "Hi" is 01001000 01101001. Spaces and punctuation have codes too, so a whole sentence can be written the same way.
Result: Hi = 01001000 01101001
The same two characters answer in every base: 'Hi' is 72 105 in decimal, 48 69 in hex, 110 151 in octal and 01001000 01101001 in binary. To do it for a whole message, convert a message into binary code.
How do you read binary code?
Split the string into 8-bit groups, turn each group into its decimal value, and look that value up in the ASCII table: 01001000 is 72, and 72 is H. A converter does the lookup for you.
The grouping matters more than the digits. Drop one bit and every group after it shifts, so a line that decodes into nonsense is usually a spacing problem rather than a value problem. The binary translator for 8-bit groups does the splitting and the lookup in one pass.
Which character code does binary code use, ASCII or UTF-8?
Plain English text uses ASCII codes 0–127, one byte each. UTF-8 keeps those bytes and adds two to four bytes for other characters, so é is 11000011 10101001. Most tools default to UTF-8.
ASCII defines 128 characters, codes 0–127, using 7 bits; in practice each code is stored in one 8-bit byte with a leading 0.
UTF-8 encodes each character in 1 to 4 bytes. Characters 0–127 use one byte identical to ASCII, so ASCII text is valid UTF-8.
é is U+00E9 and encodes as C3 A9 (2 bytes); € is U+20AC and encodes as E2 82 AC (3 bytes); 😀 is U+1F600 and encodes as F0 9F 98 80 (4 bytes).
é is the shortest of those three examples: the code point is 233, and the two UTF-8 bytes are hex C3 A9, octal 303 251 and binary 11000011 10101001. Two groups, one character — which is where a byte count and a character count stop agreeing. where UTF-8 takes over from ASCII has the rest of the rule.
What is the difference between binary code and the binary number system?
The binary number system is base 2: 1010 means the number ten. Binary code uses the same digits to label things, so 01000001 can mean the number 65 or the letter A depending on the code in use.
The number system has place value: each position is worth twice the one to its right, and the digits are added up. A code has no arithmetic in it at all — the value is looked up in a table that somebody agreed on.
One hexadecimal digit equals exactly 4 bits (16 = 2⁴); one octal digit equals exactly 3 bits (8 = 2³). Hex and octal are therefore converted by grouping bits, and hex ↔ octal passes through binary.
That grouping is why binary, octal and hex are three views of one bit string. Decimal has no such shortcut; repeated division and positional expansion are the two routes between any pair of bases.
Is binary a language?
Binary is a code, not a language: it has no grammar or vocabulary of its own. "Binary language" usually means machine code, the binary instructions a processor runs, or plain text written in binary.
The distinction matters when someone asks for a translation. A phrase can be written in binary, and the result is the same phrase in a different notation — not a second phrase that means the same thing.
Where is binary code used?
Every file a computer stores is binary: text as character codes, images as pixel values, sound as samples, programs as machine instructions. Networks send the same bits over wires and radio.
- Text — one character code per character, 8 bits at a time.
- Images — a value per colour channel per pixel.
- Sound — a sample of the waveform thousands of times a second.
- Programs — machine instructions the processor decodes directly.
Who invented binary code?
Gottfried Leibniz described the binary number system in 1679; Francis Bacon's 1605 cipher used two symbols for letters; the ASCII code that maps letters to 8-bit binary was published in 1963.
The two halves arrived separately: a way of counting in twos, and an agreement about which number stands for which character. Computing needed both, and only the second one had to be negotiated.
Frequently Asked Questions
How many bits are in a byte?
8. A byte is 8 bits and holds 256 values, 0–255; a nibble is 4 bits. the method behind every converter here covers bit, nibble, byte and word in full.
What is "I love you" in binary code?
The phrase is 10 characters, so it is 10 groups of 8 bits. The value lives on the page that owns it: convert a message into binary code shows the phrase beside each of its codes.
Is binary code the same as Morse code?
No. Morse uses variable-length dots and dashes with gaps as separators; binary code uses fixed-width groups of 0 and 1, normally 8 bits per character.
The rest of the family sits on the rest of the binary converters.