Saved

Press the star next to a tool's name to save it.

All my tools

Perfect Square Calculator

Use this perfect square calculator to check whether a whole number is a perfect square or cube, see its root and prime factors, and list the first squares or cubes.

Restored your last values ·

Choose Perfect square or Perfect cube, then enter a whole number to check, or choose to list the first ones. The calculator tells you whether the number is a perfect square or cube, its root, the nearest ones on each side, and a quick test that you can do by hand.

Everything is worked out in your browser. Nothing you type is sent anywhere.

–

–

Choose what you want, enter the number, then press Check.

A perfect square calculator tells you whether a whole number is a perfect square, and, with the cube option, a perfect cube. It shows the root when there is one, the nearest perfect squares on each side when there is not, a quick test that works by hand, and the prime factors. You can also list the first squares or cubes. All the checks are exact, even for numbers with 30 digits, and everything happens in your browser.

How to use the perfect square calculator

  1. Choose Perfect square or Perfect cube.
  2. Choose Check a number and enter a whole number, or choose List the first ones.
  3. Press Check.

What a perfect square is

The Wikipedia article on square numbers defines a square number, or perfect square, as an integer that is the square of an integer; in other words, it is the product of some integer with itself.[1] The first ones are 0, 1, 4, 9, 16, 25, 36, 49, 64, 81 and 100. The cube article defines a cube number, or perfect cube, as a number that is the cube of an integer, and its list starts 0, 1, 8, 27, 64, 125, 216, 343, 512, 729 and 1,000.[2] The number 144 is a perfect square because 12 × 12 = 144, and 27 is a perfect cube because 3 × 3 × 3 = 27. The number 64 is both, because 8 × 8 = 64 and 4 × 4 × 4 = 64. The cube article says that this happens if and only if the number is a perfect sixth power.[2]

Checking by hand: the last digit

The square number article says that a square number can end only with the digits 0, 1, 4, 5, 6 or 9.[1] So a number that ends in 2, 3, 7 or 8 is never a perfect square, and you can rule it out at a glance. The converse is not true: 14 ends in 4 and is not a square. The page also says that all odd squares leave a remainder of 1 when divided by 8, and that squares of even numbers are even and divisible by 4.[1] The calculator shows the last-digit test with each answer.

Checking by prime factors

The page states that a number is a square if and only if, in its canonical representation as a product of primes, all exponents are even.[1] For 144, the factors are 2⁴ × 3², and both exponents are even, so it is a square, and the square root is 2² × 3 = 12. For 145, the factors are 5 × 29, and both exponents are 1, so it is not a square. The calculator shows the factorization for numbers up to 10¹², which is where trial division is quick.

Checking cubes by the digital root

For cubes, the article lists the last digits of n³ for n from 0 to 9 as 0, 1, 8, 7, 4, 5, 6, 3, 2, 9, and it notes that, unlike squares, cubes do not have a small number of possibilities for the last two digits.[2] It also says that all perfect cubes have a digital root of 1, 8 or 9, which means that their values modulo 9 can only be 0, 1 or 8.[2] A number such as 11, with digital root 2, cannot be a cube. The calculator shows this test for the cube option. The test can only rule a number out. A number with digital root 1 may or may not be a cube.

How the calculator decides

The calculator does not rely on the tests above. It finds the integer square or cube root with exact whole-number arithmetic and checks whether raising it to the power gives the number. That is why it is accurate for very large numbers, where a floating-point square root would round. When the number is not perfect, it shows the nearest perfect numbers below and above it, and how far away they are. For 145 the nearest squares are 12² = 144 and 13² = 169.

The gaps between squares and cubes

The article notes that the gap between consecutive squares is n² − (n − 1)² = 2n − 1, so the gaps grow by 2 each time: 1, 3, 5, 7 and so on.[1] For cubes, n³ − (n − 1)³ = 3(n − 1)n + 1.[2] That is why perfect squares and cubes become rarer as the numbers grow, and why a large number is usually not perfect. The list option shows how fast they grow. The first 10 squares add up to 385, and the first 5 cubes add up to 225.

Worked examples

Is 2,025 a perfect square? Its last digit is 5, which is possible for a square, and the calculator finds the root, 45, because 45 × 45 = 2,025. Is 5,000 a perfect square? The nearest squares are 70² = 4,900 and 71² = 5,041, so it is not, and it is 41 short of the next square and 100 over the last. Is 1,728 a perfect cube? Yes, because 12 × 12 × 12 = 1,728, and its digital root is 1 + 7 + 2 + 8 = 18, then 9, which is allowed for a cube. These checks are quick to do in the calculator and easy to repeat on a long list of numbers.

Why perfect squares matter

Perfect squares come up in simplifying radicals, in solving quadratic equations by factoring or completing the square, in the Pythagorean theorem, and in geometry, where the area of a square is the square of its side. Perfect cubes appear in volumes of cubes and in cube roots. Knowing the first fifteen squares and the first ten cubes by heart makes mental arithmetic and algebra faster, and the list option is a handy way to learn them.

Common mistakes

  • Judging by the last digit alone. It can rule out a number but not prove it.
  • Confusing squares and cubes. 25 is a square but not a cube.
  • Using a decimal. A perfect square here means the square of a whole number.
  • Forgetting that 0 and 1 are perfect. They are the squares of 0 and 1.

What next

Use this often? Add Perfect Squa to your Home screen.

Frequently asked questions

What is a perfect square calculator?

A tool that checks whether a whole number is the square of another whole number, and, with the cube option, the cube of one.

How do I tell if a number is a perfect square?

Find its square root. If the root is a whole number, it is a perfect square. A quick check is that it can only end in 0, 1, 4, 5, 6 or 9.

Is 64 a perfect square and a perfect cube?

Yes. It is 8 × 8 and also 4 × 4 × 4. A number is both if and only if it is a perfect sixth power.

Is 0 a perfect square?

Yes. It is the square of 0, and the article's list of squares starts with 0.

How large a number can I check?

Up to 30 digits. The checks use exact whole-number arithmetic.

What went wrong?

We only receive the reason you pick, never what you typed into the tool.

Thanks for your feedback.

More Math Tools