Random Number Generator: A Practical Guide to Fair Selections
A random number generator is useful when a decision needs a transparent selection from a
stated range. It can support a classroom order, a casual game, a small sample, a draw from
numbered entries, a testing fixture, or an assignment sequence. The important part is not
the colourful result card; it is the rule that is defined before the result is generated.
Decide the smallest and largest allowed integer, whether endpoints are included, how many
results are needed, which values are excluded, and whether a value may repeat. This page
makes those decisions visible before generating a result.
Toolyfi uses the browser Web Crypto API to obtain random values, then applies rejection
sampling to turn those values into a selected integer without a simple modulo shortcut. The
tool is designed for local browser-side choices, not for regulated lotteries, legal
drawings, gambling, cryptographic key material, medical allocation, or any setting that
needs independently audited randomness. In those settings, use a process, recordkeeping,
oversight, and specialised system appropriate to the consequence of the decision.
Define the Range Before You Generate
A range needs a clear inclusive meaning. If the minimum is 1 and the maximum is 10, this
page can select any whole number from 1 through 10, including both ends. Enter negative
values when a problem genuinely uses them. Do not use a number range as a substitute for a
participant list unless you have first assigned and recorded a unique number for every
eligible participant. If people are entering a contest, explain the numbering method before
a winner is selected.
The count control asks how many values you want in one run. A single value is appropriate
for a simple pick. Several values can be useful for a random order, test data, or a small
selection. A larger output is not automatically a better sample. Consider whether the
requested values are meaningful, whether repeats are acceptable, and whether the selection
rules are understandable to everyone affected.
Repeats and No-Repeats Are Different Rules
With repeats allowed, a later output can equal an earlier output. This is similar to drawing
a value, recording it, and returning it to the pool before the next draw. It is useful for
simulation or when each value represents an independent attempt. With no repeats, each
selected value is removed from the available set. This is useful for a raffle order, team
assignment, or choosing distinct rows from a numbered list. The number of requested results
cannot exceed the number of permitted values when no-repeat mode is active.
Do not describe no-repeat output as more random than repeat output. It is a different
sampling rule. Both can be appropriate if they are defined first. The fairness question is
whether the method matches the stated purpose and is applied consistently, not whether the
page produces a more dramatic-looking result.
Using Exclusions Carefully
The exclusions field accepts comma-separated integers and simple integer ranges such as
4-7, 13, 21. It is useful when some values are unavailable, reserved, already
selected, or intentionally outside the choice. An exclusion that falls outside the stated
minimum and maximum does not change the eligible set. Review exclusions before generating,
especially if the result affects another person. A typo in an exclusion can be more
consequential than the random number itself.
For a large or sensitive selection, prepare the eligible list independently and keep it with
the record of the draw. This tool can help produce a local result, but it does not know who
a number represents or whether a list was complete. Transparency comes from documenting the
range, exclusions, mode, time, and result—not from calling any generic online tool a proof
of fairness.
What Browser Cryptographic Randomness Means
Browsers expose crypto.getRandomValues() for generating cryptographically
strong random values. This page uses that source rather than Math.random(). It
then rejects values outside the largest evenly divisible portion of the 32-bit range before
mapping a value into the requested interval. That detail avoids a small distribution
imbalance that can occur when an arbitrary number is reduced with a remainder operation
alone. It is an appropriate method for a client-side number picker.
Even so, randomness from a browser does not create a public audit trail. A person operating
the page could change inputs, rerun the tool, or choose when to reveal a result. If a
process needs impartial oversight, capture the stated rules before the draw, have observers,
use an approved platform, and preserve the relevant evidence. The code can be technically
sound while the surrounding process remains unclear.
Examples for Everyday Use
For a classroom speaking order, number the students visibly, set the range to the
participant count, turn on no repeats, and generate as many positions as needed. For a
casual board game, use a range that matches the game’s instruction and allow repeats when
each turn is independent. For testing, generate a small list within a known range and save
the output with the test record. For an office icebreaker, make clear that the result is a
voluntary prompt rather than a meaningful performance score.
Do not use a casual number generator to assign healthcare, employment, admissions, legal,
financial, safety, or gambling outcomes without the suitable formal process. Those decisions
can require policies, eligibility checks, records, jurisdictional rules, and accountability
that a static browser page does not provide.
Copying and Downloading Results
The copy control puts the visible result into the browser clipboard where supported. The
download control creates a plain-text file containing the run settings and the selected
values. A file is useful when you need a simple local record, but it is not tamper-proof
evidence. Anyone can edit a text file after download. If a result must be auditable, pair it
with a documented process and whatever independent recordkeeping the situation requires.
Before sharing a result, check that it contains no private participant data. This page works
with integers; it does not upload a list of names. If you map numbers to people elsewhere,
keep that mapping in a suitable controlled record. A number that seems anonymous may become
personal data when combined with another list.
Common Input Problems
A minimum greater than a maximum is not a valid range. A non-integer input changes the
meaning of an integer picker and is rejected. A no-repeat request can fail when the count
exceeds the available allowed numbers after exclusions. A very broad range combined with a
large set of exclusions can be slow or impractical to enumerate. The page explains these
conditions rather than silently producing a partial selection. Correct the rule first, then
generate again.
When a range is extremely large, ask whether a number is the right representation of the
selection. A spreadsheet row, a database record, or a named participant list may need a
separate reviewed workflow. Randomness is one part of selection; data quality and
eligibility remain separate tasks.
Fairness Is a Process, Not a Button
A fair-looking interface is not the same as a fair process. State who is eligible, freeze
the list at a known time, decide whether alternates are needed, state how duplicate or
invalid selections will be handled, and record the rule before generating anything. If
reruns are permitted, say why and who authorises them. If an exclusion occurs, document it.
These steps make the outcome explainable to the people who care about it.
For low-stakes personal decisions, the local tool can be a quick neutral nudge. For
higher-stakes decisions, build the governance around the draw before relying on the result.
The same random integer can be harmless in a game and inappropriate in a serious allocation.
Simple Checklist Before a Draw
Confirm the inclusive minimum and maximum. Confirm the requested count. Decide whether
repeats are allowed. Review exclusions and the number of eligible values. Explain the method
to relevant people. Generate once under the stated rule. Copy or download the result if a
local record is useful. Verify that the output is used only for the purpose you described.
Toolyfi’s Random Number Generator provides a local numeric selection step; it does not
certify a contest, validate a participant list, or replace oversight.
Random Selection Is Not a Substitute for Measurement
A random number can help order options or choose from a defined eligible set, but it cannot
repair a poorly defined list. If the entries are incomplete, duplicates are present, or some
participants were not eligible at the stated deadline, a fair numeric selection cannot make
the outcome fair. Prepare the data first. Count it, identify duplicate identifiers, document
the inclusion rule, and preserve the version that was used for the selection. This is
particularly important when a number maps to a person, a ticket, a record, or a position in
a spreadsheet.
In research or quality work, random sampling needs an additional step: interpret what the
sample represents. A random subset from one shift, one device, or one date might not
represent the broader population. The generator can provide values, but it cannot choose a
sampling frame, calculate a confidence interval, control for bias, or explain a conclusion.
Use appropriate statistical planning when a decision depends on those questions.
Independent Draws and Ordered Draws
When repeats are allowed, each selection is independent in the sense that the previous
displayed value does not reduce the eligible set. A value can appear twice by design. When
no-repeat mode is selected, the output order can be read as a shuffled selection order: the
first value is selected from all allowed values, the second from the remaining values, and
so on. This distinction matters in games and selection procedures. State whether the values
are merely a set or whether their displayed sequence determines first choice, second choice,
reserve status, or another role.
If a selection needs alternates, include them in the requested no-repeat count and define
the order in advance. For example, generate three values where the first is the main
selection and the next two are reserves. Do not generate additional reserves only after
seeing an unwanted initial result unless the process clearly allowed that. Clear rules
protect both the people administering the draw and those affected by it.
Ranges, Negative Values, and Zero
Whole-number ranges can include negative values and zero. This is helpful for a technical
test, a mathematics exercise, or any indexed system that includes zero. It is less useful
for a participant draw when people expect labels beginning at one. Confirm what each number
means before sharing a result. A number does not carry its own context; the mapping from
number to option should be clear to everyone who needs to understand the outcome.
Use integer fields because a decimal result raises another question: how should it be
rounded, and what does it represent? If you need a random decimal for a simulation, a random
identifier, a weighted choice, or a distribution other than uniform integers, use a tool and
method designed for that task. This page intentionally focuses on transparent uniform
selection among permitted whole numbers.
Exclusions and Input Review
Exclusions are powerful because they change the eligible set. For a simple situation, enter
one value per comma. A short range such as
4-7 is helpful when several consecutive numbers are unavailable. Review the
final range, count, no-repeat setting, and exclusions before generating. When the exclusion
list is long, consider whether a separate prepared list of allowed identifiers would be
easier to audit than a wide numerical interval with many removed values.
The page limits the practical range it enumerates in the local browser. This prevents a very
large range combined with exclusions from creating an unreasonably heavy page operation.
That is a design boundary, not a claim that smaller selections are automatically more fair.
For a large dataset, a database, spreadsheet, or audited program may be the right
environment.
Recording a Low-Stakes Draw
For a club activity, teaching example, or small internal process, a simple record can be
enough: date, operator, eligible range, exclusions, repeat rule, requested count, and
resulting values. The download feature creates a convenient plain-text summary of those
inputs. It does not stop later editing, establish identity, or prove that the run happened
at a particular time. If evidence is needed, add observers, approved records, screen capture
under an agreed policy, or the process required by the organisation.
Never represent a local text export as independently verified proof. Accurate language
matters. It is better to say that a result was generated using stated inputs in a browser
tool than to imply certification that does not exist.
Security, Secrets, and Random Numbers
Although this page uses browser cryptographic randomness for the numeric selection, it is
not intended to generate passwords, authentication tokens, encryption keys, recovery codes,
or gambling outcomes. Those uses have requirements beyond the choice of random source:
length, encoding, storage, threat model, protocol, auditability, and sometimes regulation.
Use the Password Generator for its specific browser-side credential workflow and use
established platform tooling for technical secrets.
Do not put confidential information in exclusions or use an output number as a security
secret simply because it was selected unpredictably. A random number becomes sensitive only
in the context of how a system uses it. The page does not store an access policy, rotate a
secret, or protect a copied result from being shared.
A Note on Weighted Choices
Every permitted integer on this page has the same intended chance of selection. Some
real-world choices require different probabilities: a drawing where entries have different
ticket counts, a simulation based on observed frequencies, or a capacity allocation with
policy-based priority. Do not try to create a weighted system by loosely repeating numbers
without documenting the method. Use a transparent weighted-selection process that
stakeholders can review.
Equal-probability selection is valuable precisely because it is simple to explain. Where
equality is not the rule, the replacement rule should be just as clear.
Final Responsible-Use Reminder
State the range, count, exclusions, and repeat policy first. Verify eligible inputs.
Generate once according to the rule. Record the result only to the extent appropriate for
the situation. Provide an alternative process when people cannot reasonably participate
through a numbered draw. Toolyfi’s local generator is useful for simple numeric choices, but
responsible use depends on the human process around it.
Build the Selection Rule Before Opening the Tool
Random output cannot repair an unclear selection rule. Before entering a minimum and
maximum, write down what each eligible number represents. A classroom activity might assign
one number to each participant. A meeting might assign numbers to discussion topics. A test
plan might map values to sample cases. The mapping needs to exist before you see a result.
If numbers are allocated after a value appears, it becomes easy—often unintentionally—to
create a rule that favours a preferred outcome.
A short selection note can make ordinary decisions easier to explain later. Include the
eligible population, the numbered list, the range, exclusions, requested count, repeat
policy, and what will happen if a chosen item is unavailable. For a simple one-person turn,
this may be a sentence: “Participants numbered 1 through 18; number 7 is absent; choose one
unique integer.” For a larger process, use a dated record, independent observers, and the
organisation’s own published procedure. The tool displays numbers; it does not create the
procedure for you.
Check the Available Pool, Not Just the Original Range
The size of an inclusive integer range is calculated as maximum minus minimum plus one. A
range from 1 to 10 therefore contains ten possible values, not nine. Exclusions reduce that
pool. If you exclude 3, 4, and 9 from 1 through 10, only seven integers remain. In no-repeat
mode, you cannot request more unique values than remain in the pool. This is not a technical
failure; it is a useful validation check that prevents a silent duplicate or an invented
answer.
Review exclusions carefully when negative numbers are involved. A comma-separated entry such
as -4--2 represents a range from negative four through negative two, while
-3 represents one negative integer. If a note is difficult to read, simplify it
into individual values or check the stated range before generating. Values outside the
selected range do not change the eligible set, but including them in a selection note can
make a record harder for another person to understand.
Use Repeats Only When Independent Draws Match the Task
Repeats are appropriate when every draw should be independent, like rolling a die several
times. A value chosen on one draw remains available for the next. It is normal for the same
number to appear again, even immediately. Turning repeats off changes the task. The tool
then takes a value out of the available pool after selecting it, which is closer to drawing
a labelled token from a container and setting it aside.
This distinction is especially important for turnout order, small group assignment, seat
selection, or choosing several distinct test cases. If the same person, topic, or case must
not be selected twice in one batch, choose no-repeat mode. If a repeat is acceptable, leave
it off and explain that each selection is independent. Do not switch modes after an
inconvenient result. If a rule must change, state the reason and conduct a new selection
with the revised rule visible to anyone affected.
Record Results in a Useful, Minimal Format
A copied result is easiest to reuse when it contains enough context to be interpreted but
not unrelated private information. For a low-stakes internal draw, record the date, range,
exclusions, unique/repeat setting, requested quantity, and resulting values. The download
option creates a plain-text snapshot that is practical for a project folder or meeting note.
It is not a tamper-proof audit trail, timestamp authority, or proof that a third party
observed the process.
Avoid putting passwords, account identifiers, medical details, or other sensitive
information into the range labels or downloaded filename. This tool works with numeric
values only and is not a secure record system. If the result is linked to a sensitive
workflow, keep the mapping between numbers and identities inside the approved system for
that workflow. A neutral result like “4, 11, 16” is less likely to expose information if a
copied note is shared by mistake.
Browser Randomness, Transparency, and Limits
Toolyfi uses the active browser’s Crypto API as its local selection source and maps those
values into the requested integer set with a method that discards unusable values instead of
forcing a biased fit. That makes the page suitable for ordinary local selections where a
dependable browser implementation is available. It does not make the page a certified draw,
a physical random-number service, or a replacement for rules imposed by a regulator,
tournament, employer, school, or platform.
For a high-consequence decision, determine the required process before selecting any number.
You may need an approved external provider, an audit record, a witness, a signed policy, or
a process that participants can independently verify. A browser page cannot provide those
safeguards by itself. The most honest way to use a random-number tool is to match its modest
technical role to a well-defined human process rather than treating a button click as proof
of fairness in every context.