Square-Free Number Checker

Enter a positive integer to test square-freeness and see its prime factorisation.

Result

No
2^2 × 3^2 × 5
2

How it is calculated

Enter a whole number from 1 to 1,000,000,000; zero, negatives, decimals and larger values give no result. The tool finds the prime factorisation by trial division, trying 2, 3, 4, … while p × p ≤ m, and dividing each prime out as many times as it fits. Any leftover above 1 is a prime itself. The number is square-free when every exponent is exactly 1, which is the same as saying no square greater than 1 divides it. Exponents are written with a caret, so 2^2 means 2². If the number is not square-free, the tool shows only the smallest prime that repeats (the prime itself, not its square), even if several primes repeat; for a square-free number that line shows a dash. The number 1 is reported as square-free.

Worked example

Take n = 180. Dividing by 2 twice leaves 45, and dividing by 3 twice leaves 5, which is prime. So the factorisation is 2^2 × 3^2 × 5. Two primes appear with exponent 2, so 180 is not square-free: it is divisible by 4, by 9 and by 36. The tool reports the answer No and names 2 as the repeated prime, the smallest one. Compare 30 = 2 × 3 × 5: every prime appears once, so 30 is square-free.

Try this example →

Common mistakes

  • Assuming that even numbers cannot be square-free (or that odd ones always are). Evenness does not decide it: 10 is square-free, but 12 is not, because 4 divides 12.
  • Reading the repeated factor shown as the full list. When several primes repeat, as in 180, only the smallest one (2) is named; the factorisation line shows all of them.
  • Confusing the repeated prime with the square that divides the number. The tool shows 2, but the square dividing 180 is 4 (and also 9 and 36).
  • Entering a number above one billion or a decimal like 2.5 and expecting an answer. Only whole numbers from 1 to 1,000,000,000 are accepted, and anything else shows no result.
  • Thinking that a prime or 1 is a special case. Every prime and the number 1 are square-free, since no square greater than 1 divides them.

About this calculator

An integer is square-free when no perfect square greater than 1 divides it evenly — equivalently, when every prime in its factorization appears with exponent exactly 1. So 10 = 2 × 5 is square-free, but 12 = 2² × 3 is not, because 4 divides it. The calculator finds the full prime factorization and checks whether any prime repeats to answer the question directly.

Square-free numbers show up throughout number theory rather than everyday arithmetic: the Möbius function μ(n), central to inclusion-exclusion arguments and the study of the Riemann zeta function, is defined to be zero exactly when n is not square-free, and nonzero (±1) exactly when it is. Square-free counting also appears in problems about simplifying square roots — √n reduces to an integer times an irrational only when n itself is not square-free — and in recreational and olympiad-style number theory, where testing square-freeness is a common warm-up step before harder factorization problems.

Enter any positive integer and the calculator reports whether it is square-free, alongside its prime factorization so you can see exactly which prime, if any, is repeated.

Was this helpful?

You can pick up to 3 reactions.

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators