How many codes does a 4-digit PIN have?
A 4-digit PIN has exactly 10,000 possible codes, from 0000 to 9999. Each of the four places can be any of the ten digits, so the count is 10 times 10 times 10 times 10, which is 10,000. That sounds like a lot, but a computer does not get tired, and it does not need to be lucky: it just tries them one by one until one works.
How long that takes depends on one thing only: how fast the attacker can guess. A person typing by hand manages about 1 guess per second, so all 10,000 codes take 10,000 seconds, which is about 2.8 hours. A fast computer guessing 100,000 times a second finishes all 10,000 codes in a tenth of a second. The PIN is the same in both cases; the speed is what changes.
How to use the estimator
Pick a guessing speed from the list. Slow means 1 guess per second, a person typing by hand. Manual means 10 per second. Online means 100 per second, a fast script against a website. Offline means 1,000 per second, a program working on a stolen file. Fast computer means 100,000 per second, a strong machine with no limits.
The result shows two numbers. The worst case is the time to try all 10,000 codes, which is what happens if your PIN is the very last one tried. The average is half of that, because on average the right code comes up halfway through the list. The bar shows where the worst case sits, from seconds on the left to hours and days on the right.
Worked example
Take an online attack at 100 guesses per second. The worst case is 10,000 divided by 100, which is 100 seconds, or about 1.7 minutes. The average is half of that, 50 seconds. So an attacker with a fast script breaks a 4-digit PIN in under two minutes, if nothing stops them.
Now take a person typing by hand at 1 guess per second. The worst case is 10,000 seconds, which is 2.8 hours, and the average is 5,000 seconds, which is 1.4 hours. And a fast computer at 100,000 guesses per second finishes the worst case in 0.1 seconds, which is why no PIN is safe once the attacker has the file and no lockout to slow them down.
Who uses this estimator
Anyone choosing a phone PIN uses it most, because the number makes the risk real. A 4-digit PIN feels safe when you type it every day, but the maths says a machine breaks it in seconds, and only the phone lockout saves it. That is why banks and phones lock after a few wrong tries.
It also helps teachers explaining security to students, parents setting up a child’s first phone, and small business owners choosing a PIN for a safe or a card machine. The lesson is the same every time: the PIN is only as strong as the lockout behind it, and a longer PIN is always stronger than a short one.
Honest limitations
This tool counts all 10,000 codes as if they were equally likely, but real attackers do not start at 0000 and count up. They start with the common codes: 1234, 0000, 1111, 1212, 7777, and birth years like 1990. If your PIN is one of those, it breaks in the first few guesses, not after thousands. Your birthday is the worst PIN of all, because anyone who knows you can guess it.
The tool also ignores lockouts. A phone that locks for 30 seconds after 5 wrong tries, and wipes after 10, makes a 4-digit PIN very strong in practice, because the attacker never gets to try 10,000 codes. And it ignores that a 6-digit PIN has 1,000,000 codes, which is 100 times harder, so the real fix is a longer PIN, not a cleverer 4-digit one.
Frequently asked questions
How long to crack a 4-digit PIN? At 100 guesses per second, the worst case is 100 seconds and the average is 50 seconds. At 1 guess per second, the worst case is 2.8 hours. The speed of the attacker decides the answer, not the PIN itself.
Is a 4-digit PIN safe? Only with a lockout. A phone that locks after a few wrong tries makes a 4-digit PIN safe enough for daily use, because the attacker never gets 10,000 tries. Without a lockout, a fast computer breaks it in under a second.
Is a 6-digit PIN much better? Yes, 100 times better. A 6-digit PIN has 1,000,000 codes instead of 10,000, so every time in this tool gets 100 times longer. A 6-digit PIN is the simplest upgrade you can make, and it costs nothing.
What is the worst PIN to pick? Your birth year, 1234, 0000, and any repeated number like 1111. Attackers try those first, so they break in seconds even at slow speeds. Pick a random-looking number you can remember, and never use your birthday.
También disponible en español: Estimador De Tiempo Para Descifrar Un PIN – Cuánto Tardaría Un PIN De 4 Dígitos
