Skip to main content
Generator Hut

6 Digit Random Number Generator

Six-digit codes from 000000 to 999999 — the standard shape for one-time passcodes.

Generator settings

Between 1 and 10,000.

No number repeats within a batch.

Pads to 6 characters, so 42 becomes 000042.

Generated numbers

Your numbers will appear here. Press Generate to start.

Generate random six digit numbers between 000000 and 999999. Six digits is the shape almost every one-time passcode takes, which makes this the right generator for mocking up an authenticator flow, seeding SMS verification fixtures, or issuing membership and reference numbers that need a million-wide space instead of ten thousand.

Why use this tool?

OTP shaped

Zero-padded to six characters, matching what authenticator apps, SMS codes and email verification inputs expect.

A million combinations

The 000000–999999 space is a hundred times larger than a four digit code, which meaningfully raises the cost of guessing.

100% private

Generation happens in your browser using the Web Crypto API. Nothing is sent to a server, nothing is logged, and there is no analytics script watching what you produce.

Bulk export

Generate up to 10,000 codes and take them away as CSV or JSON without touching a spreadsheet formula.

How this 6 digit random number generator works

Values are drawn from the Web Crypto API, which reads the operating system's cryptographically secure entropy pool. That matters more at six digits than four, because these codes are frequently used as real authentication factors rather than as convenience labels.

The tool maps raw entropy onto the range 0–999,999 with rejection sampling, discarding draws that would skew the distribution. Every one of the million possible codes is equally likely on every generation.

Unique mode tracks issued values and rejects collisions. Across a million-value range, collisions are rare in small batches anyway — but 'rare' is not 'never', and unique mode removes the question entirely.

How to use it

  1. Step 1: Enter a quantity

    Choose how many six digit codes you need, from 1 to 10,000.

  2. Step 2: Pick your options

    Enable Unique only to guarantee no repeats, keep zero-padding on so short values stay six characters wide, and sort the batch if that helps you review it.

  3. Step 3: Generate and take them with you

    Press Generate, then copy an individual code, copy the whole batch, or export it as CSV or JSON.

Example usage

Mocking an authenticator flow
A handful of codes to paste into a staging login screen while you build and test the verification path end to end.
Member reference numbers
Five hundred unique six digit references, sorted ascending, exported as CSV and imported into a membership system.
Raffle and prize draws
One code per entrant, generated in bulk so ticket numbers are unguessable rather than sequential.

Frequently asked questions

Is a 6 digit code secure enough for two-factor authentication?

Six digits is the industry standard for time-based one-time passcodes, and it is secure in that context because codes expire in around thirty seconds and attempts are rate-limited. On its own, a static six digit code has only a million possibilities and should never be treated as a password.

How is this different from a real TOTP generator?

A TOTP app derives its code deterministically from a shared secret and the current time, so a server can verify it. This tool produces independent random codes with no shared secret, which is what you want for issuing codes, seeding test data or running a draw.

Can I generate all one million codes?

Batches are capped at 10,000 per generation to keep the page responsive. Generate and export repeatedly if you need more, or use a script for very large volumes.

Why is padding on by default?

Because 000042 is a valid six digit code and dropping its leading zeros would make it a two digit one. Padding keeps every result the same width. Turn it off if you want plain integers.

Do you store the codes I generate?

No. There is no server involved and no logging. The codes exist only in your browser tab.

Browse every tool in Random Number Generators & Number Tools.