Random Number Generator

Generate one or more unbiased random integers with optional uniqueness.

How to use

These are example steps; replace the values for your task.

  1. Set the minimum, maximum and count.
  2. Enable no duplicates when values must be unique.
  3. Generate and check the range and count.

Enter values

Result

—

About this tool

Generate integers for draws, ordering, or test data with the browser's cryptographic random source. Rejection sampling prevents modulo bias.

When duplicates are disabled, the requested count cannot exceed the number of integers in the selected range.

Try a use case and check the result

Compare selecting an entire range without replacement with drawing more numbers than the range contains.

Example buttons replace the inputs and settings above and calculate. Restore previous input steps back one example at a time. After trying multiple examples, repeat restore to return to your original input. This history is lost when the page closes.

Draw five unique integers from 1–5

Input and settings

Minimum 1 / Maximum 5 / Count 5 / Unique: on

Expected result

Each of 1, 2, 3, 4 and 5 appears once; order may vary.

Draw eight integers from −2–2 with replacement

Input and settings

Minimum -2 / Maximum 2 / Count 8 / Unique: off

Expected result

Eight integers from −2 through 2. Some values must repeat; values and order are not fixed.

How to read the result

Both endpoints are included. The first draw must contain the whole five-value set because it selects all candidates without replacement. The second needs repeats because eight draws use five possible values. With replacement does not mean equal counts for each value. Repeating a previous result can be valid.

Scope and limits

Endpoints must be safe integers; the inclusive range has at most 2³² values and count is 1–1,000. Unique count cannot exceed the range. Web Crypto with rejection sampling avoids modulo bias, but the tool provides no source audit, draw certification or seed for replay. Examples perform real draws and replace the result. Restore returns input settings only, not previous draws; generate again after restoring.

Verification: existing functions check the complete candidate set, signed bounds/counts and rejection of excessive unique counts. Browser checks validate actual integer outputs, bounds, duplicates and checkbox restoration without assuming specific random values.

Continue with the next task

Draw five unique numbers from 1 to 5

With minimum 1, maximum 5, count 5 and no duplicates, each integer from 1 to 5 appears once in a random order. The order can differ between runs.

Both endpoints are included. Six unique integers cannot be drawn from 1 to 5.

Frequently asked questions

Can the same number appear twice?

Yes, unless you select No duplicates.

Can it generate decimals?

No. This tool generates integers only.

Are results saved?

No. Inputs and results are not stored.

Related tools

Inputs and storage

Keep any content you need before clearing. This tool does not autosave inputs or results. Reloading or closing the page, clearing inputs or resetting may discard your work.

Favorites and language preferences are stored separately and may be lost when site data is cleared. Tool resets and site-data deletion do not delete files already downloaded to your device.

Explore tools & games

All 120 tools · 16 games

All 120 tools · 16 games

Text & writing 26

Calculators & converters 22

Date & time 12

Images & PDF 26

Data & web 28

Random & handy 6

Games 16