Random 4 Digit Number Generator

Generate random 4-digit numbers and PINs, 6-digit codes or numbers of any length from 1 to 12 digits, with leading zeros, unique digits and weak-PIN filtering.

What you can do here

How to generate a random 4-digit number

Leave Digits on 4 and press Generate. With leading zeros allowed every code from 0000 to 9999 is possible, 10,000 in all, each with the same chance. Choose Not allowed if the number must be a true four-digit number from 1000 to 9999 (9,000 possibilities). Set How many to generate a list, up to 10,000 at once; with No repeats ticked, a list of 10,000 is every 4-digit code in a random order.

Random 4-digit PIN without weak codes

The 4-digit PIN preset ticks Skip weak PINs, which throws away codes people guess first: repeated digits like 1111, runs like 1234 or 9876, repeated pairs like 1212, the most common PINs such as 2580 and 6969, years from 1900 to 2039 and month-day dates like 0714. Tick Every digit different for codes like 3918 where no digit repeats. For a real bank card or phone, choose your own PIN privately rather than one shown on a screen.

Random 6-digit number generator

Set Digits to 6, or use the 6-digit number preset, for values from 000000 to 999999: one million possibilities. The 6-digit code preset also skips weak codes such as 123456, 111111 and 121212, which makes it handy for sample verification codes, OTP mock-ups, ticket numbers, lottery-style draws and test data. Show as Grouped formats them as 482-719.

Other lengths

DigitsRange with leading zerosPossible valuesTypical use
3000 to 9991,000Lock combinations, CVV-style test values
40000 to 999910,000PINs, door codes, raffle numbers
500000 to 99999100,000ZIP-like codes, order numbers
6000000 to 9999991,000,000Verification codes, tickets
800000000 to 99999999100,000,000Reference numbers, test account IDs

The .csv download writes each number as a text formula so spreadsheets keep leading zeros instead of turning 0042 into 42.

Frequently asked questions

How many 4-digit numbers are there?

10,000 if leading zeros are allowed (0000 to 9999) and 9,000 if the first digit cannot be zero (1000 to 9999).

Can I generate a random 4-digit PIN?

Yes. Use the 4-digit PIN preset. It skips weak PINs such as 1234, 1111, 1212, common patterns, years and dates. Pick your real bank or phone PIN privately.

How do I generate a random 6-digit number?

Set Digits to 6 or click the 6-digit number preset, then press Generate. There are one million possible 6-digit numbers from 000000 to 999999.

Can I make a list with no duplicates?

Yes. Keep No repeats ticked and set How many, up to 10,000. The tool never returns more unique numbers than exist for the chosen length.

Can every digit in the number be different?

Yes. Tick Every digit different to get numbers such as 3918 or 507264 where no digit appears twice. That works for up to 10 digits.

Is it random enough for codes?

Numbers come from the browser crypto.getRandomValues generator, so each digit is equally likely. Nothing is sent or stored.

Related tools

Random Number GeneratorRandom String GeneratorRandom Phone NumberRandom ZIP CodeRandom Letter Generator