CalcUnit Logo

How to Calculate PIN Generator

Generate a random PIN of any length.

The Formula

Random digit generation

The pin generator formula uses the mathematical relationship: Random digit generation. Each variable in the formula represents a measurable quantity that affects the final result.

What Each Variable Means

Every value in the pin generator formula, what it measures, and the value used in the worked example on this page:

VariableTypeExample value
PIN Length (digits)Input (you provide)4
Character Set Size (10=digits, 26=letters, 36=alphanumeric)Input (you provide)10
Brute-Force Attempts / SecondInput (you provide)1,000
Total Possible PINsResult (calculated)—
Entropy (bits)Result (calculated)—
Time to Crack (seconds)Result (calculated)—
Time to Crack (minutes)Result (calculated)—
Time to Crack (hours)Result (calculated)—
Average Crack Time (50%) secResult (calculated)—

Step-by-Step Method

  1. 1Write down the values you know: PIN Length (digits), Character Set Size (10=digits, 26=letters, 36=alphanumeric), Brute-Force Attempts / Second.
  2. 2Substitute your known values into the formula: Random digit generation.
  3. 3Work through the arithmetic in the standard order of operations — parentheses first, then exponents, then multiplication and division, then addition and subtraction.
  4. 4Check that your result carries the correct unit and falls in a reasonable range for the problem.
  5. 5Verify your answer with the interactive PIN Generator Calculator — it solves the same formula instantly.

Worked Example

Take a concrete case: pin length (digits) = 2, with the other inputs at the typical values from the variables table above. Substituting into the formula gives total possible pins = 100, entropy (bits) = 6.64, time to crack (seconds) = 0.10, time to crack (minutes) = 0.0017, time to crack (hours) = 0.000028, average crack time (50%) sec = 0.05. These numbers are solved by the same engine that powers the PIN Generator calculator, so you can reproduce them exactly by entering the same inputs there.

PIN Length (digits)Total Possible PINsEntropy (bits)Time to Crack (seconds)Time to Crack (minutes)Time to Crack (hours)Average Crack Time (50%) sec
1103.320.010.00020.0000030.01
21006.640.100.00170.0000280.05
310009.971.000.01670.0002780.50
41000013.2910.000.16670.0027785.00
510000016.61100.001.66670.02777850.00
6100000019.931000.0016.66670.277778500.00
810000000026.58100000.001666.666727.77777850000.00
101000000000033.2210000000.00166666.66672777.7777785000000.00
2010000000000000000000066.44100000000000000000.001666666666666666.750027777777777777.77734450000000000000000.00

How each result changes as pin length (digits) changes, holding the other inputs constant.

Practice Problems

1. 4-digit ATM PIN: With PIN Length (digits) 4, Character Set Size (10=digits, 26=letters, 36=alphanumeric) 10, Brute-Force Attempts / Second 1,000, what are the results?

Answer: With PIN Length (digits) 4, Character Set Size (10=digits, 26=letters, 36=alphanumeric) 10, Brute-Force Attempts / Second 1,000, the results are Total Possible PINs 10,000, Entropy (bits) 13.29, Time to Crack (seconds) 10.00, Time to Crack (minutes) 0.1667, Time to Crack (hours) 0.002778, and 1 more more results.

2. PIN Length (digits) 7.5, Character Set Size (10=digits, 26=letters, 36=alphanumeric) 10, Brute-Force Attempts / Second 1,000 — work it out, then check the answer.

Answer: Entering PIN Length (digits) 7.5, Character Set Size (10=digits, 26=letters, 36=alphanumeric) 10, Brute-Force Attempts / Second 1,000 gives Total Possible PINs 31,622,777, Entropy (bits) 24.91, Time to Crack (seconds) 31,622.78, Time to Crack (minutes) 527.0463, Time to Crack (hours) 8.784105, and 1 more more results.

Frequently Asked Questions

What is the formula for pin generator?

The formula is: Random digit generation. Generate a random PIN of any length.

What values do I need to calculate pin generator?

You need pin length (digits), character set size (10=digits, 26=letters, 36=alphanumeric), brute-force attempts / second. The calculator produces total possible pins, entropy (bits), time to crack (seconds), time to crack (minutes), time to crack (hours), average crack time (50%) sec from those inputs.

What is the pin generator when pin length (digits) is 2?

With pin length (digits) = 2, the result is total possible pins = 100, entropy (bits) = 6.64, time to crack (seconds) = 0.10, time to crack (minutes) = 0.0017, time to crack (hours) = 0.000028, average crack time (50%) sec = 0.05. This is worked through in full in the example on this page.

Related Topics

pinrandomsecurity

Use the Interactive Calculator

Skip the manual math — get instant results with our free PIN Generator calculator.

Open Calculator

Related Calculators