Coding–Decoding for Beginners: Letter, Number and Word Codes
Learn the position of every letter and its opposite letter, then crack six kinds of code (letter shifts, opposite and reversed letters, number codes, moves that change from letter to letter, substitution and sentence codes) through worked examples, a checklist for any coding question and a revision list.
By the end of this lesson you will be able to find the rule behind a letter, number or word code, check that it fits every letter, and use it to code a new word or decode a given code.
Already confident? Skip to practice: Coding–Decoding quiz
What a coding question looks like
A word is turned into a code by a fixed rule. You are shown one or two words with their codes. Your job is to find the rule, then use it on a new word (coding), or run it backwards on a code (decoding).
For example: "In a certain code, SUN is written as TVO." Each letter has moved one place forward in the alphabet: S→T, U→V, N→O. So in that code, PEN is written QFO.
Some words used below:
- Position: a letter's place in the alphabet, counting from A. A is 1, B is 2 … Z is 26.
- Reverse position: the place counting from Z instead. Z is 1, Y is 2 … A is 26.
- Opposite letter: the letter at the same place from the other end. A and Z are opposites, B and Y are opposites, and so on.
- Move (or shift): moving a letter forward (+) or back (−) by some places. A + 2 is C; C − 2 is A.
The alphabet by number
Almost every letter code works with positions, so learn this table first.
| Letter | Position | Opposite letter | Its position |
|---|---|---|---|
| A | 1 | Z | 26 |
| B | 2 | Y | 25 |
| C | 3 | X | 24 |
| D | 4 | W | 23 |
| E | 5 | V | 22 |
| F | 6 | U | 21 |
| G | 7 | T | 20 |
| H | 8 | S | 19 |
| I | 9 | R | 18 |
| J | 10 | Q | 17 |
| K | 11 | P | 16 |
| L | 12 | O | 15 |
| M | 13 | N | 14 |
The first two columns give A to M. The last two give N to Z if you read them from the bottom up: N is 14, O is 15 … Z is 26.
Three facts to remember:
- The positions of a letter and its opposite always add up to 27. G is 7, so its opposite is the letter at 27 − 7 = 20, which is T.
- Reverse position = 27 − position. T is 20th from the start, so it is 27 − 20 = 7th from the end.
- The alphabet splits in half between M (13) and N (14). Every letter in the first half has its opposite in the second half.
Two memory aids:
- EJOTY gives every fifth letter: E = 5, J = 10, O = 15, T = 20, Y = 25. To find any other letter, start from the nearest one. R is two letters before T, so R = 20 − 2 = 18.
- Some opposite pairs read like short words or names: B–Y ("by"), G–T (GT Road), H–S (High School), I–R (Indian Railways).
Moving past Z. The alphabet goes round in a circle: after Z comes A again. So Y + 3 is Z, A, B: the answer is B. With numbers: Y is 25, 25 + 3 = 28, and 28 − 26 = 2, which is B. Going back past A works the same way: B − 3 is A, Z, Y, so the answer is Y (2 − 3 = −1, and −1 + 26 = 25, which is Y).
Count the moves, not the letters. To move C forward by 2, count the steps after C: D is one, E is two. So C + 2 is E. Do not count C itself.
Worked examples
Read each example slowly. The first two show every step. In the later ones, some steps are left for you, with the answer just below.
Example 1: Every letter moves the same number of places
Question: In a certain code, MELON is written as OGNQP. How is GRAPE written in that code? How is OXYGEN written?
Write the word and its code one above the other, letter under letter, and write the move under each pair:
M E L O N
O G N Q P
+2 +2 +2 +2 +2- Use positions to find each move. M is 13 and O is 15, so 15 − 13 = 2. E is 5 and G is 7: again 2.
- Every letter has moved 2 places forward, so the rule is +2.
- Apply +2 to GRAPE: G→I, R→T, A→C, P→R, E→G. So GRAPE is written ITCRG.
- Apply +2 to OXYGEN: O→Q, X→Z, Y→A (Y + 1 is Z, Y + 2 is A), G→I, E→G, N→P. So OXYGEN is written QZAIGP.
The principle: find how far each letter moved. If every letter moved by the same amount, move every letter of the new word by that amount. Past Z, carry on from A (subtract 26 from the position).
To decode, run the rule backwards. Which word is written as TCTG in this code? Move each letter 2 places back: T→R, C→A, T→R, G→E. The word is RARE.
Example 2: Opposite letters, and words written backwards
Question: (a) In a certain code, COPPER is written as XLKKVI. How is SILVER written in that code? (b) In another code, CLOUD is written as DUOLC. How is DESK written in that code?
Part (a)
- Check the moves first: C (3) → X (24) is +21, but O (15) → L (12) is −3. The moves are not equal, so this is not a simple shift.
- Add the positions of each pair instead: C + X = 3 + 24 = 27, O + L = 15 + 12 = 27, P + K = 16 + 11 = 27, E + V = 5 + 22 = 27, R + I = 18 + 9 = 27.
- The positions in every pair add up to 27, so each letter is replaced by its opposite letter.
- Apply it to SILVER, using the table: S→H, I→R, L→O, V→E, E→V, R→I. So SILVER is written HROEVI.
Part (b)
- The code DUOLC uses exactly the same letters as CLOUD: C, L, O, U and D.
- Read the code from right to left: C, L, O, U, D. The word has simply been written backwards.
- DESK written backwards is KSED.
- Some codes take one more step. In a third code, HOUSE is written as FTVPI. HOUSE written backwards is ESUOH, and then each letter has moved one place forward: E→F, S→T, U→V, O→P, H→I.
- Your turn: how is GIFT written in that third code?
Check: GIFT written backwards is TFIG. Moving each letter one place forward gives UGJH.
The principle: when the moves are not equal, try two checks. Do the positions in each pair add up to 27 (opposite letters)? Does the code use the same letters as the word (a change of order)? Opposite coding works both ways: the opposite of the code gives back the word.
Example 3: Number codes
Question: In a certain code, CAT is written as 24 and BAG is written as 10. How is DOG written in that code?
- Write the positions: C = 3, A = 1, T = 20, and B = 2, A = 1, G = 7.
- Try adding them: 3 + 1 + 20 = 24 and 2 + 1 + 7 = 10. Both match, so the code is the sum of the positions.
- Your turn: find the positions of D, O and G, and add them.
Check: D = 4, O = 15, G = 7, and 4 + 15 + 7 = 26. DOG is written 26.
Two other number codes:
- Positions side by side: HEAD is written 8514, because H = 8, E = 5, A = 1, D = 4.
- Reverse positions: if the sum does not match, try adding the reverse positions (27 minus each position). With reverse positions, CAT gives 24 + 26 + 7 = 57.
The principle: for a number code, write each letter's position and try the simple rules in turn: the sum, the positions side by side, then the reverse positions. Test the rule on every example you are given, because one example can fit two rules. CAB could be 6 by adding (3 + 1 + 2) or by multiplying (3 × 1 × 2); a second example tells you which.
Example 4: The move changes from letter to letter
Question: In a certain code, BOOK is written as CQRO. How is DESK written in that code?
- Write the moves: B→C is +1, O→Q is +2, O→R is +3, K→O is +4.
- The same letter O became Q the first time and R the second time. So the move depends on the place of the letter in the word, not on the letter: +1 for the first letter, +2 for the second, +3 for the third, +4 for the fourth.
- Your turn: apply +1, +2, +3 and +4 to D, E, S and K.
Check: D + 1 = E, E + 2 = G, S + 3 = V, K + 4 = O. DESK is written EGVO.
The principle: if the moves are not equal, list them in order and look for a pattern, such as +1, +2, +3, +4 (growing) or +1, −1, +1, −1 (taking turns). Then apply the same pattern to the new word, place by place.
Example 5: One word is called another
Question: If sky is called water, water is called land, land is called tree and tree is called fire, where does a fish live?
- Answer the question in real life first: a fish lives in water.
- Now find what water is called in this code. The question says "water is called land".
- So the answer is land.
- Your turn: on what do mangoes grow?
Check: mangoes grow on a tree, and tree is called fire. The answer is fire.
The principle: find the real answer first, then replace it with what it is called in the code. The real word (water) is not the answer, and neither is the word that is called water (sky).
Example 6: A code language for sentences
Question: In a certain code language:
- 'pit na sa' means 'big red ball'
- 'na ko pit' means 'red big box'
- 'sa ri na' means 'small red ball'
What is the code for 'ball'?
The code words need not be in the same order as the English words, so match them by what two sentences have in common.
- Compare the second and third sentences. The only code word in both is na, and the only English word in both is red. So na means red.
- Compare the first and third sentences. The code words in both are na and sa; the English words in both are red and ball.
- Since na means red, the other shared code word must mean ball: the code for ball is sa.
- Your turn: what is the code for 'small'?
Check: the third sentence is 'sa ri na' = 'small red ball'. Since sa means ball and na means red, ri means small.
Matching by order would have given sa = small from the third sentence, which is wrong. Comparing the first two sentences finishes the job: pit means big, and ko means box.
The principle: the code words that two sentences share stand for the English words they share. Compare two sentences at a time, start with a pair that shares only one word, and never match words by their order.
How to attack any coding question
- Write the word and its code one above the other, letter under letter.
- If the code is a number, write each letter's position and try the sum, the positions side by side, then the reverse positions.
- If the code uses the same letters as the word, look at the order: is it written backwards?
- Otherwise, write how far each letter moved. All the same means a shift. A pattern such as +1, +2, +3 means a place-by-place rule. If the moves are not equal, check whether the positions in each pair add up to 27 (opposite letters).
- If no single rule fits, try two steps: write the word backwards first, then look at the moves again.
- Test your rule on every letter, and on the second example if there is one. One letter that does not fit means the rule is wrong.
- Apply the rule to the new word, letter by letter. Past Z, carry on from A. To decode, run the rule backwards.
- For a sentence code, compare two sentences at a time. For an "is called" question, find the real answer first, then give its code name.
Revision: the rules in one place
Learn these facts by heart: A = 1 … Z = 26; EJOTY = 5, 10, 15, 20, 25; the positions of a letter and its opposite add up to 27; reverse position = 27 − position.
- Shift: every letter moves the same number of places. Move each letter of the new word by that number; past Z, start again at A.
- Opposite letters: the positions of each letter and its code letter add up to 27 (A–Z, B–Y, C–X … M–N). Replace each letter by its opposite.
- Written backwards: check the example pair first. If the code holds exactly the word's letters in reverse order, the rule is plain reversal. If the letters are reversed and also moved, write the example word backwards and find the move from that. Then apply the same steps to the new word.
- Place by place: the moves change in a pattern, such as +1, +2, +3 or +1, −1, +1. Apply the same pattern, place by place.
- Number code: try the sum of the positions, the positions side by side, and the sum of the reverse positions.
- Substitution ("X is called Y"): find the real answer, then give its code name.
- Sentence code: the code words two sentences share stand for the English words they share. Compare two sentences at a time.
Common mistakes
- Counting the starting letter. C + 2 is E (D, E), not D.
- Stopping at Z. Y + 3 is B: carry on from A (Z, A, B).
- Checking only the first letter. In BOOK → CQRO the first move is +1, but the others are +2, +3 and +4. Check every letter before you trust a rule.
- Matching a sentence code by order. In Example 6 that would give sa = small, which is wrong.
- Giving the real word in an "is called" question. The answer is the code name, not the real word.
Next
The next Reasoning topics are Analogy and Classification and Number and Letter Series. Letter series use the same alphabet positions, so keep the table above handy.
Ready to test this lesson? Take the Coding–Decoding quiz
How this was made: Drafted with AI assistance; every formula and worked figure recomputed independently; spot-checked by the editor on 23 October 2026.