Letter-to-Number Coding: How Text Gets Turned Into Numbers

Long before modern computers, people were already turning letters into numbers for telegraphs, ciphers, and early coding systems — the same basic idea that ASCII later standardized into the system every computer still uses today.

crossorigin="anonymous">

The Basic Idea

Letter-to-number coding simply means assigning each letter of the alphabet a specific numeric value, so “A” might become 1, “B” becomes 2, and so on, or — in the system computers actually use — “A” becomes 65 under ASCII. Once every letter has a fixed number, any word or sentence can be rewritten as a sequence of numbers instead of letters.

Simple Ciphers vs. ASCII

A simple classroom cipher usually numbers the alphabet 1 through 26, which is easy to do by hand but has no room for capital letters, punctuation, or spaces without extra rules. ASCII solves this by using a much wider range, 0 through 127, which leaves enough room to give uppercase letters, lowercase letters, digits, and symbols each their own unique number without any overlap.

From Numbers to Binary

Once a letter has a number, that number can be written in any number system, including binary. ASCII’s numbers are almost always shown in their binary form because that’s how a computer actually stores them — the number 65 becomes 01000001, and it’s this binary version, not the plain decimal number, that lives inside a computer’s memory.

Where You’ll See This Idea Used

Letter-to-number coding shows up anywhere text needs to be processed as data rather than read visually — sorting words alphabetically, searching text for a pattern, encrypting a message, or compressing a file all rely on treating each character as a number first.

The A1Z26 Cipher

The simplest letter-to-number code gives A the number 1, B the number 2, and so on up to Z, which is 26. The word “HELLO” becomes 8 5 12 12 15, and “CODE” becomes 3 15 4 5. Because there is no number for spaces or punctuation, messages usually keep spaces as breaks between words.

Shifting Letters: The Caesar Cipher

A Caesar cipher moves every letter a fixed number of places along the alphabet. With a shift of 3, “HELLO” becomes “KHOOR”. With a shift of 13, which is known as ROT13, “HELLO” becomes “URYYB”. Because the alphabet has 26 letters, applying ROT13 twice returns the original text. These ciphers are fun for puzzles but offer no real security, since there are only 25 possible shifts to try.

Comparing Four Ways to Code “HI”

  • A1Z26: 8 9
  • ASCII decimal: 72 73
  • ASCII binary: 01001000 01001001
  • ASCII hex: 48 49

The same letters, four different number forms. Only the ASCII ones cover lowercase letters, digits and punctuation.

Word Values and Puzzles

A common puzzle adds up the A1Z26 values of a word. “CAT” adds to 24, and “DOG” adds to 26. Numerology and word games use this idea, but computers use it for something more practical: sorting text, because comparing numbers is easy.

Why Computers Need a Standard

A private cipher works only if both sides know the rule. ASCII became the shared rule so any computer could read any other computer’s text. When one system used a different table, text turned into strange symbols. For the shared table in detail, read our binary to ASCII guide.

Try the Full Conversion Yourself

Seeing a whole sentence converted this way makes the pattern click faster than working out a few letters by hand. Our binary code translator converts full sentences into ASCII binary instantly, and our text to hex converter shows the same letters coded as hexadecimal numbers instead, which is often the more compact way programmers write the same values.

Leave a Comment