How binary encodes text
Computers store text as numbers. Each character gets a number, called a code point (A is 65, a is 97, space is 32), and that number is written in binary: base 2, using only 0 and 1. A group of 8 binary digits (bits) is a byte, which can hold any value from 0 to 255.
Each bit position stands for a power of two. Reading a byte from left to right, the positions are worth 128, 64, 32, 16, 8, 4, 2 and 1. Add up the positions that hold a 1 and you get the number. For 01000001, only the 64 and the 1 are switched on, so 64 + 1 = 65, which is the letter A.
ASCII and UTF-8
ASCII, from 1963, defines 128 characters: English letters, digits, punctuation and control codes. Since 128 values fit in 7 bits, ASCII is a 7-bit code. Capital letters start at 65 and lowercase letters at 97, exactly 32 higher. That is why A (01000001) and a (01100001) differ in only one bit.
UTF-8 is the encoding used by almost every website today. Its first 128 values match ASCII exactly, so English text looks the same in both. Every other character, such as é, ß, 日 or an emoji, is stored as 2 to 4 bytes. Those bytes always start with 1, so they never get mixed up with plain ASCII.
ASCII table: letters and digits
Space is 32 (00100000), the full stop is 46 (00101110) and the question mark is 63 (00111111).
Worked examples
Text to binary: "Hi". H is 72 = 64 + 8, so it becomes 01001000. Lowercase i is 105 = 64 + 32 + 8 + 1, so it becomes 01101001. "Hi" in binary is 01001000 01101001, which is 48 69 in hex.
Binary to text: 01001111 01001011. The first byte has 64, 8, 4, 2 and 1 switched on, which adds up to 79, the letter O. The second has 64, 8, 2 and 1 switched on, which is 75, the letter K. The message is "OK".
A character outside ASCII: "é". Its code point is 233, which is too big for 7 bits. UTF-8 stores it as two bytes, 11000011 10101001 (C3 A9 in hex). The leading 110 means "a two-byte character starts here" and the leading 10 means "this byte continues it". An emoji such as 😀 takes four bytes: F0 9F 98 80.
If binary decodes to strange symbols, the bit grouping is usually off. Check that each group has exactly 8 digits, or switch between 7-bit and 8-bit mode.
Binary and Morse code
Morse code is also a two-symbol code, but its letters have different lengths and it relies on timing gaps, while binary uses fixed-size bytes. Try the Morse code translator to compare, or see the Morse alphabet.