Home / Learn / Maths / Number trick decoderTool #L134 (formerly #1249)

Number trick decoder: think of a number tricks explained with algebra

Run a think-of-a-number trick with any number and with the letter n side by side, see each step as bags and counters, and find out why the answer is always the same, or how a mind reader gets your number back. Build your own trick too.

Keep it one tap away for everyday use.

Bookmark Number trick decoder?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Pick trick
  2. Any number
  3. Use n
  4. Decode
Nothing is uploadedWorks offline once open

Pick a trick

n

Your number. Try a few: the right-hand column (the algebra) does not change.

The trick, step by step

StepWith 12With n

Tap a row to see it as bags and counters below. A bag holds n counters; a red counter takes one away.

Why it works

Try this

  • Run "Always 5" with 3, then with 1000. Watch the right-hand column: the n's cancel in the last step.
  • In "Make your own", build a trick whose answer is always 10. Hint: multiply, add, divide by the same number, then take away your number.
  • Try the mind reader on a friend. Take 165 from their answer: the hundreds are their number.
  • Make a trick that divides by 3. Pick a number that gives a fraction on the way. Does the end still work?

Check yourself

Fresh questions every time. Nothing is saved.

What it does

“Think of a number. Double it. Add 10. Halve it. Take away the number you first thought of. Your answer is 5!” Tricks like this feel like magic, but a little algebra explains them completely. This page runs a trick two ways at once:

  • with a number you choose, so you see the trick work, and
  • with the letter n, standing for any number at all, so you see why it works.

Each step is also drawn as bags and counters: a bag holds n counters (we don’t know how many), and a loose counter is worth 1. Doubling doubles the bags and the counters; halving shares them into two equal groups; taking away your number removes one bag. When every bag has gone, the answer cannot depend on the number you thought of.

Some tricks keep the n on purpose. In the mind reader the answer is 100n + 165, so the trickster takes away 165 and reads your number from the hundreds. Type your friend’s answer and the page decodes it.

It fits the Class 8 maths chapter Algebra Play, where number tricks lead into expressions and equations. Collecting like terms with tiles is in algebraic identity tiles, and solving an equation by doing the same to both sides is in the balance scale equation solver.

How to use it

  1. Pick a trick: Always 5, Always 3, Always 7, Mind reader or Back to you.
  2. Move the n slider (or type any number, even a decimal or a negative one). The middle column changes; the right-hand column, the algebra, does not.
  3. Tap a row of the table to see that step as bags and counters.
  4. Read Why it works. It either says “Always …” or tells you how to undo the trick. For a trick that keeps n, type an answer in the box to get the starting number.
  5. Choose Make your own to build a trick from steps: add, take away, multiply, divide, and add or take away “your number”. Undo removes the last step.

A worked example

Choose Always 5 and keep n = 12:

Step With 12 With n
Think of a number 12 n
Double it 24 2n
Add 10 34 2n + 10
Halve it 17 n + 5
Take away your number 5 5

Halving 2n + 10 gives n + 5 (half of each part). Taking away n leaves 5, whatever n was.

Now the Mind reader with n = 12: × 5 gives 60, + 6 gives 66, × 4 gives 264, + 9 gives 273, × 5 gives 1 365. In algebra: 5n, 5n + 6, 20n + 24, 20n + 33, 100n + 165. Type 1365 in the decoder: 1 365 − 165 = 1 200, and 1 200 ÷ 100 = 12.

Tips

  • To make an “always” trick, the bags must cancel: whatever you multiply by, divide by the same number later, then take away your number once.
  • Dividing can make fractions on the way (try “divide by 3” with n = 4). The final answer still works, because the algebra is exact.
  • The bags-and-counters picture is drawn for small whole numbers; for fractions or very big numbers the page shows the expression instead.

Check yourself

Four fresh questions each time: the answer of an “always” trick, decoding a friend’s answer, expanding a bracket, and one more trick to unravel. Nothing is saved.

FAQ

Why does a negative or decimal number work too? Every step is an ordinary operation on numbers, and the algebra a·n + b holds for any n. Only “divide by 0” is not allowed.

Is this the NCERT book? No. It covers the same topic with fibub’s own tricks and questions. fibub is not part of NCERT.

Where the numbers come from

  • Think-of-a-number tricks and their algebra are standard school mathematics. The tricks, pictures and questions on this page were written for fibub.
  • Checked by hand and against exact fraction arithmetic in Python (fractions.Fraction) for every built-in trick and 500 random home-made tricks.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Change log for Number trick decoder

  1. Add #1249 Number trick decoder Details on GitHub

Every change to fibub

Related tools

Symbolic algebra #T370 Type an expression and simplify, expand or factor it, differentiate it, integrate it (with definite integrals), or substitute values. Exact fractions, answers you can copy as SymPy or LaTeX, and an honest 'could not integrate' when it is out of reach. Checked against sympy. Linear pairs #L74 Type two equations and see their lines cross, run parallel or lie on top of each other. The ratio test says how many solutions there are, and the substitution and elimination methods are worked step by step with exact fractions. Algebraic identity tiles #L75 See each algebraic identity as a picture: slide a and b and the square or rectangle splits into its pieces with the identity filled in. Watch a² − b² turn into (a + b)(a − b), and pull the cube (a + b)³ apart into eight blocks. Balance equations #L135 Put x boxes and 1-weights on a two-pan balance, then solve the equation one move at a time: take the same from both pans or share both into equal groups until x is alone. Slide a guess to see the beam tip. Quadratic explorer #L68 Slide a, b and c and watch the parabola move: vertex, roots and the discriminant update live, completing the square is drawn with tiles, and the middle term is split for you. With fresh practice questions. Pythagoras proof playground #L69 Drag a right triangle and watch the squares on its sides add up. Slide through four visual proofs (rearrangement, Bhaskara, similar triangles, Baudhayana) with your own side lengths, and list Pythagorean triples.