4-Digit Random Number

A random number with exactly 4 digits — 1,000 to 9,999.

—
Options

"4-digit" and "1000-9999" are not the same request. A 4-digit number runs from 1000 to 9999 with no leading zeros, which is why this page starts at 1,000 rather than zero.

Common uses: phone passcodes, four-digit PINs and short one-time codes. The distinction matters when the output has to be exactly 4 characters — for example when it becomes an ID or a code.

How to use it

  1. Generate — the range is fixed to 1,000-9,999.
  2. Set a count if you need a batch of codes.
  3. Copy as a block; each value is on its own line.

Exactly 4 digits, not "4 characters"

A 4-digit number runs from 1,000 to 9,999 — 9,000 possible values. Numbers below 1,000 are shorter when written, which is why they are excluded here.

If you need padded output such as 00042, that is a fixed-width string, not a number. Use the random alphanumeric generator with the digits-only setting and a length of 4 instead.

Reviewed 2026-10-21. This tool runs entirely in your browser — no server, no account, and nothing you generate is stored.

Frequently asked questions

Is a random 4-digit PIN secure?

For a phone passcode with a hard attempt limit, yes — 10,000 combinations with lockout after ten tries is out of reach. For anything on a network, no: 4 digits is trivial to brute force.

How many possible 4-digit numbers are there?

9,000. That is 9 × 10^3, which is why adding one digit multiplies the space by ten.

Are the digits independent of each other?

The number is drawn uniformly from the whole range, so yes in effect — but it is not built digit by digit, which means values like 1111 are just as likely as 7392.

Related tools

More from Random numbers.