Skip to content

Random 4 Digit Number Generator

Get a random four-digit number from 1000 to 9999.

Loading the random 4 digit number generator… If nothing appears, please turn on JavaScript.

This random 4 digit number generator gives you a whole number from 1000 to 9999. There are 9,000 possible four-digit numbers, and every one has the same chance. Generate one at a time or a whole list for games, sample data and practice.

How to use the 4 digit number generator

  1. Press Pick a number (or the spacebar).
  2. Pick several at once by changing how many numbers you want under Options.
  3. Keep “No duplicates” on so each number appears only once per draw.
  4. Sort the results from lowest to highest if you are drawing several.

When to use it

  • Games and puzzles: pick a secret number for a guessing game like bulls and cows.
  • Test data: fill a spreadsheet with order numbers or IDs.
  • Maths practice: round, add or divide four-digit numbers.
  • Raffles: give each ticket a unique four-digit number.
  • Locker or room numbers for stories, games and role-play.

Keep, copy and share your numbers

Every result has a lock button. Locked results stay put when you generate again, so you can keep the numbers you like and reroll the rest. The history panel keeps your earlier results, and the back arrow takes you to the previous set if you generated one time too many. Press Wheel to put the current results on a spinning wheel and pick one with a bit of drama.

Use Copy to copy the results as a plain list, CSV or JSON, or download them as a file. Share copies a link that shows exactly the same results to whoever opens it, which is handy for games, classes and group chats.

Leading zeros and PIN codes

Strictly speaking, numbers like 0427 are not four-digit numbers, so this generator starts at 1000. If you want codes that can start with zero, set the lowest number to 0 and the highest to 9999, then add leading zeros yourself. Random codes made here are generated privately in your browser, but for bank cards and important accounts, choose a PIN through the official provider and never share it.

Drawing without repeats

With “No duplicates” on, each number in a single draw is different, just like pulling slips from a hat. To keep going over several rounds without repeats, turn on “Exclude already shown”: the generator then works through every number before any comes up again. Need a different range? Change the lowest and highest numbers under Options, or use the main random number generator.

How the randomness works

Every result comes from your browser’s built-in cryptographic random number generator (crypto.getRandomValues). We use rejection sampling, so every item has exactly the same chance of being picked, with no bias toward the start or end of the list. Nothing is sent to a server, and share links store the exact results so the person you send them to sees the same thing.

Frequently asked questions

What range does it use?

From 1000 to 9999, the 9,000 numbers with exactly four digits.

Can I generate many at once?

Yes. Set how many numbers you want under Options.

Can the numbers start with 0?

Not by default. Set the lowest number to 0 if you need codes like 0427.

Can I avoid repeats?

Yes. Keep "No duplicates" on.

Should I use it for my bank PIN?

Use the official process from your bank, and never share your PIN.

Is the random 4 digit number generator free?

Yes. It is free, with no sign-up.