Why Square Numbers Can End Only in Certain Digits

Introduction

Look at the last digit of any whole number square and you will find that it belongs to a short list: 0, 1, 4, 5, 6, or 9. A square cannot end in 2, 3, 7, or 8. This is not a coincidence or a rule about large numbers: it follows from what happens when each possible final digit is squared.

The short answer: square the final digit

The last digit of a whole number’s square depends only on the last digit of the number itself. For example, 23 and 83 both end in 3, so their squares end in the same digit: 232 = 529 and 832 = 6,889. In both cases, the final digit is 9.

There are only ten possible final digits for a whole number: 0 through 9. Squaring each one gives the complete set of possibilities:

02 = 0, so a number ending in 0 can have a square ending in 0.
12 = 1, so a number ending in 1 can have a square ending in 1.
22 = 4, so a number ending in 2 can have a square ending in 4.
32 = 9, so a number ending in 3 can have a square ending in 9.
42 = 16, so a number ending in 4 can have a square ending in 6.
52 = 25, so a number ending in 5 can have a square ending in 5.
62 = 36, so a number ending in 6 can have a square ending in 6.
72 = 49, so a number ending in 7 can have a square ending in 9.
82 = 64, so a number ending in 8 can have a square ending in 4.
92 = 81, so a number ending in 9 can have a square ending in 1.

The results end in 0, 1, 4, 5, 6, or 9. No possible final digit produces 2, 3, 7, or 8, which is why those digits cannot appear at the end of a whole number square.

Why the rest of the number does not matter

A whole number can be split into its tens part and its final digit. For instance, 47 is 40 plus 7, and 123 is 120 plus 3. In general, write a whole number as 10q + r, where q is the tens part and r is its final digit, from 0 to 9.

When the number is squared, the result is (10q + r)2, or 100q2 + 20qr + r2. The first two terms are multiples of 10, so they end in zero. They cannot change the final digit. The only part that determines the square’s last digit is r2, the square of the original final digit.

Take 47 as an example. Its final digit is 7, and 72 = 49 ends in 9. The full calculation is 472 = 2,209, which also ends in 9. The larger parts of the calculation affect the digits before the final one, but not that final digit.

This reasoning also explains why the pattern repeats for numbers with the same final digit. Adding 10 changes the number but not its final digit, so it cannot change the final digit of its square. For example, 122 = 144 and 222 = 484 both end in 4.

The pattern in modular arithmetic

Mathematicians have a compact way to describe calculations that focus on remainders. In arithmetic “modulo 10,” numbers are treated according to their remainder after division by 10. The remainder is exactly the digit in the ones place: 47 leaves a remainder of 7, while 120 leaves a remainder of 0.

So the question “What is the last digit of a square?” is equivalent to asking “What remainders can squares have when divided by 10?” The ten possible starting remainders are 0 through 9. Squaring them gives remainders 0, 1, 4, 9, 6, 5, 6, 9, 4, and 1. Removing repeats leaves the possible remainders 0, 1, 4, 5, 6, and 9.

The notation n2 ≡ 4 (mod 10), for instance, means that the square of n leaves a remainder of 4 when divided by 10. It says that the square ends in 4. This notation is useful in mathematics, but the underlying idea is simply the familiar final-digit pattern.

Why four digits are impossible

The result can also be understood by grouping the possible endings into pairs. A number ending in 1 or 9 has a square ending in 1. A number ending in 2 or 8 produces 4. Endings 3 and 7 produce 9, while 4 and 6 produce 6. The remaining endings, 0 and 5, produce 0 and 5 respectively.

There is no starting digit in this list whose square ends in 2, 3, 7, or 8. Since every whole number must have one of the ten possible final digits, there is no other route to those endings. They are ruled out for squares of whole numbers, whether the number is small or extremely large.

This is a useful distinction: a digit may occur in a number without being possible as the final digit of its square. For example, 2 appears in many squares, such as 121 or 256, but neither square ends in 2. The restriction is about the ones place, not about which digits may appear elsewhere.

Examples that make the rule visible

Consider numbers ending in 4. Since 42 = 16, their squares end in 6. For example, 142 = 196 and 342 = 1,156. The numbers differ, but the final digit of each square follows the same rule.

Numbers ending in 5 offer another clear case. Their squares always end in 5: 152 = 225, 252 = 625, and 1052 = 11,025. The result 52 = 25 supplies the final digit, while the other parts of the calculation determine the earlier digits.

For a number ending in 8, the square must end in 4 because 82 = 64. Thus 182 = 324 and 282 = 784. These examples also show that the final digit is a quick check, not a way to calculate the entire square.

How the rule can help

The pattern is useful when checking arithmetic. If someone claims that a whole number has a square ending in 7, the claim must be wrong: no whole number square can end in 7. Likewise, a result claimed to be a perfect square can be ruled out immediately if it ends in 2, 3, 7, or 8.

This is a test for impossibility, not a complete test for whether a number is a square. A number ending in 1, 4, 5, 6, 9, or 0 might be a square, but that ending alone does not prove it. For example, 14 ends in 4, yet it is not a square of a whole number. Checking the final digit narrows the possibilities; further reasoning is needed to confirm a square.

The rule can also help when solving a problem that asks for a whole number with a square ending in a specified digit. If the requested ending is 2, 3, 7, or 8, there is no solution among whole numbers. If the requested ending is 9, possible starting endings include 3 and 7. That identifies the possible final digits of the number, though it does not determine the number itself.

Does the rule apply to negative numbers?

Yes. A negative whole number squared has the same result as its positive counterpart: (-7)2 = 49, just as 72 = 49. The minus sign disappears because a negative multiplied by a negative is positive. Therefore, negative whole numbers follow the same final-digit rule.

The statement is specifically about squares of whole numbers. If a number is not a whole number, such as a fraction or a decimal, its square need not be a whole number with a final digit in the usual ones-place sense. The familiar list of six possible endings applies when the number being squared is an integer.

A quick way to remember the possible endings

One simple memory aid is to group the starting digits by the ending they produce: 0 gives 0; 1 and 9 give 1; 2 and 8 give 4; 3 and 7 give 9; 4 and 6 give 6; and 5 gives 5. Reading the results gives the six possible final digits: 0, 1, 4, 5, 6, and 9.

These groups arise because digits equally far from 0 and 10 have the same square ending. For instance, 2 and 8 are paired, and their squares, 4 and 64, both end in 4. Similarly, 1 and 9 lead to squares ending in 1. This pairing is another way to see why ten starting digits produce only six different square endings.

Conclusion

Whole number squares can end only in 0, 1, 4, 5, 6, or 9 because the final digit of a square is determined by squaring the original number’s final digit. Checking the ten possibilities rules out 2, 3, 7, and 8. The pattern offers a quick way to spot impossible square endings, though a permitted ending alone does not prove that a number is a square.