Perfect Square Checker

Enter a number to check whether it is a perfect square.

Result

Yes
42.0000

How it is calculated

For a whole number n, the tool takes the square root, rounds it to the nearest integer r, then corrects r up or down until r² ≤ n < (r + 1)², so floating-point rounding cannot cause a wrong answer on large values. n is a perfect square exactly when r × r = n. The first output is Yes or No. The second output is the square root to four decimals: a whole number such as 42.0000 for a perfect square, otherwise the decimal root. Numbers that are negative or have a fractional part always return No, even when the decimal is a square of another decimal: 2.25 gives No with root 1.5000. For a negative number the root is shown as 0.0000, since no real square root exists.

Worked example

Check n = 1764. The square root is about 42, so r = 42. Square it: 42 × 42 = 1,764, which equals n, and the bounds also hold since 1,764 < 43² = 1,849. Therefore 1764 is a perfect square. The tool shows Yes for the square test and 42.0000 for the root. Compare 1765: r is still 42 and 42² = 1,764 is not 1,765, so the answer is No and the root displays as the decimal 42.0119.

Try this example →

Common mistakes

  • Reading the answer as a count. It is a yes/no answer: Yes means the number is a perfect square, No means it is not.
  • Expecting 2.25 or 0.25 to be accepted because their roots are 1.5 and 0.5. Here only whole numbers can be perfect squares, so decimals return No.
  • Typing a thousands separator. 1,764 gives no result at all, and 1.764 is read as the decimal 1.764, which returns No. Enter plain digits.
  • Treating a root with decimals as an error. For a non-square the root shown (such as 42.0119) is the ordinary decimal square root, not an integer.
  • Assuming a negative number gives a root of 0. The 0.0000 shown for negative input is a placeholder, and the number is simply not a perfect square.

About this calculator

The perfect square checker tests whether an integer n can be written as m² for some integer m, by computing the integer square root of n and checking whether squaring it returns n exactly. If it is a perfect square, the calculator returns m — its exact square root; if not, it reports that no integer square root exists.

Perfect squares (1, 4, 9, 16, 25, 36, …) show up throughout number theory and are a quick sanity check in Diophantine problems, Pythagorean-triple searches, and Fermat's factorization method, which works by testing whether a² − n is a perfect square for successive a. Students studying number theory, programmers writing math-heavy algorithms, and puzzle solvers use this checker to test candidates quickly instead of estimating square roots by hand.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    Before you reach for the tool, there is a fast elimination test. A perfect square can only end in 0, 1, 4, 5, 6 or 9, and it leaves a remainder of 0 or 1 when divided by 4. A number ending in 2, 3, 7 or 8 is out at once. Passing those tests proves nothing, which is where the exact check here comes in. Do you have a favourite shortcut for ruling out non-squares by hand?

Popular calculators

All Calculators