Activity and Random Tools
Random 2-, 3-, and 6-Digit Sequence Generator
Create fixed-length digit sequences for activities, games, mock data, and general tasks. Choose a set count, lock positions, or exclude digits while preserving leading zero and saving nothing.
Share this tool
Quick answer
How can multiple fixed-length digit sequences be generated with equal weight?
Choose 2, 3, or 6 digits, a set count, and optional conditions. The tool counts eligible sequences, obtains 32-bit words from Web Crypto, and uses rejection sampling to choose each branch according to its number of valid completions. Every eligible sequence therefore has equal weight, results within one draw are distinct, and leading zero is preserved.
How to use this tool
- Choose a length of 2, 3, or 6 digits and request 1–20 distinct sets.
- If needed, lock positions, exclude digits, disable leading zero, or prevent a digit from repeating inside one set.
- Check the eligible-population count recalculated from the current conditions, then generate the sequences.
- Copy the result for an activity or mock dataset, and start a new round when you want to clear the tab's temporary no-repeat list.
How the calculation works
Let D be the number of available digits and n the sequence length. With leading zero and repetition allowed, the basic population is D^n. Disabling leading zero removes zero from the first-position choices when it remains available. Disabling repeated digits counts ordered arrangements while respecting locked positions. The code uses dynamic programming to count valid completions at each position, then crypto.getRandomValues with rejection sampling to select a branch by its completion weight. Multiple sequences are sampled without returning a selected result. Locks and exclusions change the eligible population; they do not make one result preferable to another.
Examples
| Example | Input | Expected result |
|---|---|---|
| Two digits using 0–9 | |
There are 10² = 100 eligible sequences from 00 through 99, each with equal weight. |
| Three digits without leading zero | |
The first position has 9 choices and the next two have 10 each, giving 9 × 10 × 10 = 900 sequences. |
| Six digits without repeating a digit | |
There are 10 × 9 × 8 × 7 × 6 × 5 = 151,200 eligible sequences. |
Limitations
- Supports only 2-, 3-, and 6-digit sequences and at most 20 sets per draw so results remain readable and reviewable.
- There is no disclosed seed, signature, witness, or third-party log, so the output is not sole evidence for an auditable process.
- Locks, exclusions, leading-zero rules, and no-repetition rules narrow or change the eligible population; they do not improve a generated sequence.
- Visible or copied results are unsuitable for passwords, one-time codes, encryption keys, account numbers, or other secrets.
- The no-repeat history is temporary tab memory and clears on reload, tab close, or when a new round is started.
Frequently asked questions
Will leading zero disappear?
No. A result is handled as a fixed-length character sequence rather than an ordinary integer, so 007291 remains six digits when leading zero is enabled.
Does every sequence really have equal weight?
Yes, within the pool that passes the same conditions. The tool counts valid completions under every branch and uses rejection sampling to select by that weight. Locks and exclusions change the eligible pool.
How does the no-repeated-digit option work?
A digit can appear at most once inside one sequence. Locked positions must therefore differ, and at least as many digits must remain available as the chosen length.
Does the site remember results or selected conditions?
Nothing is stored on the server and the tool uses no cookie, localStorage, or URL data. The no-repeat list exists only in this tab's memory and disappears when the page reloads or the tab closes.
Can a result be used as a password or verification code?
It should not be. Results are visible and can be copied, so this is not a secret-management, one-time-code, encryption-key, or account-identifier system.
Does the tool analyze earlier data or forecast a later outcome?
No. It uses only the current conditions to create random sequences. Earlier results do not change the weight of a new round except for the clearly shown temporary no-repeat behavior.
References
- W3C — Web Cryptography Level 2: getRandomValues Verified 2026-08-13
- IETF — RFC 4086: Randomness Requirements for Security Verified 2026-08-13
Content and calculation method last reviewed: