PIN Combinations Calculator

Enter the PIN length and whether digits may repeat to get the number of possible codes.

How it is calculated

The tool counts every distinct numeric PIN of a given length using the digits 0 to 9. If digits may repeat, the count is 10n, because each of the n positions has 10 choices. If no digit may be used twice, the count is 10 × 9 × 8 × … × (10 − n + 1), because each position removes one digit from the pool. n is the length and must be a whole number from 1 to 12; with "no repeats" the maximum is 10, since there are only ten digits. Any other repeat setting is treated as repeats allowed. The tool counts the keyspace only; it does not rate how guessable a specific PIN is, and real people avoid many combinations such as 1234 or birth years.

Worked example

Take a 6-digit PIN where no digit may repeat. Choices per position: 10 for the first, 9 for the second, 8, 7, 6 and 5 for the rest. Product: 10 × 9 × 8 × 7 × 6 × 5 = 151,200. If repeats were allowed, the same length would give 106 = 1,000,000 codes, so forbidding repeats removes about 85% of the possibilities.

Try this example →

Common mistakes

  • Believing that banning repeats makes a PIN stronger. It shrinks the keyspace (151,200 instead of 1,000,000 for six digits), so it helps an attacker.
  • Entering the length as 4.5 or leaving it empty. Only whole numbers from 1 to 12 give a result.
  • Asking for a no-repeat PIN longer than 10 digits. Only ten distinct digits exist, so the tool returns nothing.
  • Equating a big keyspace with a safe PIN. Chosen PINs cluster on dates and patterns, so the real search space for people is far smaller than the count shown.
  • Forgetting that the count ignores lockout rules. A device that locks after a few attempts is safer than the number alone suggests.

About this calculator

This calculator counts the keyspace of a numeric PIN: with repeated digits allowed, an n-digit PIN has 10ⁿ possible combinations (a 4-digit PIN gives the familiar 10,000); without repeats, it's the permutation 10 × 9 × 8 × … down to (10 − n + 1), since each digit removes one option from the pool.

This is basic combinatorics with real security implications — it's exactly the calculation behind why a 4-digit PIN is trivially brute-forceable in seconds while a 6-digit or alphanumeric code is not, and it's used to reason about lock codes, ATM PINs and simple access codes.

Was this helpful?

You can pick up to 3 reactions.

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators