🎲

Random Number Generator

Generate custom ranges, decimals, and unique values

—

Random Number Generator — what it does

Generate random numbers within a range you set, choosing how many to produce, how many decimal places to use, and whether the values must all be unique. Unique mode is what makes it useful for draws and sampling, where drawing the same number twice defeats the purpose.

Worked example

Five unique whole numbers between 1 and 500, drawn for a stock-count spot check. Every click produces a new set; this is the run we recorded.

Input — settings

Minimum: 1
Maximum: 500
How many numbers: 5
Decimal places: 0
Unique values only: ticked

Output

367
266
329
118
96

Numbers are listed one per line in the order drawn, not sorted.

When this tool helps

  • Drawing winners from numbered entries in a giveaway or raffle.
  • Picking a random sample of record numbers for an audit or quality check.
  • Generating test data within a realistic range for development work.

How to use it

  1. Set the minimum and maximum values.
  2. Choose how many numbers to generate.
  3. Set decimal places, and enable unique values if needed.
  4. Generate and copy the results.

Accuracy, limits, and good practice

  • Unique mode needs a range at least as large as the count requested — asking for twenty unique numbers between 1 and 10 is impossible.
  • For an audit sample, record the range and count you used; a sample nobody can describe is hard to defend later.
  • For picking from a list of names rather than numbers, the random picker works directly on the text.

Frequently asked questions

Is the randomness fair?

It uses the browser's random generator, which is uniform across the range and fine for draws, sampling and testing.

Can I include the maximum value?

The range is inclusive of the bounds you set, so both the minimum and maximum can be drawn.

How do I shuffle a list instead?

The random picker shuffles and selects from a list of items, which is what draws from names usually need.

What are the limits on count and decimal places?

Up to 1,000 numbers per run and up to 8 decimal places; larger values are silently reduced to those caps. With “Unique values only” ticked, the count must not exceed the number of distinct values in the range at the chosen precision: 20 unique numbers between 1 and 10 shows the message “Please enter valid values.” instead of a list.

Why does nothing happen when I click Generate?

The maximum must be greater than the minimum. If they are equal or reversed, the tool does nothing and whatever was on screen stays there, with no error message. Swap or correct the two values and click again.

Related tools on this site

Everything above runs inside this page. Random Number Generator needs no account, no upload, and no server round trip — close the tab and nothing is left behind.

隨機數字產生器能做什麼

在你設定的範圍內產生隨機數字,可指定要幾個、小數位數,以及數值是否必須全部不重複。不重複模式正是它在抽獎與抽樣上好用的關鍵,因為抽到同一個數字兩次就失去意義了。

實際範例

在 1 到 500 之間抽 5 個不重複的整數,當作盤點抽核的樣本。每按一次都會產生新的一組,這裡是我們記錄到的一次。

輸入:設定

Minimum: 1
Maximum: 500
How many numbers: 5
Decimal places: 0
Unique values only: ticked

輸出:數字

367
266
329
118
96

數字依抽到的順序一行一個列出,不會排序。

什麼時候用得上

  • 從編號的參加項目中抽出贈品或摸彩得獎者。
  • 為稽核或品質檢查隨機抽取一批紀錄編號。
  • 為開發工作產生落在合理範圍內的測試資料。

使用步驟

  1. 設定最小值與最大值。
  2. 選擇要產生幾個數字。
  3. 設定小數位數,必要時開啟不重複。
  4. 產生並複製結果。

精確度、限制與實務建議

  • 不重複模式需要範圍至少等於數量——在 1 到 10 之間要二十個不重複數字是不可能的。
  • 做稽核抽樣時請記下使用的範圍與數量;說不清楚的樣本,日後很難辯護。
  • 若要從姓名清單而非數字中挑選,隨機抽選工具可直接對文字操作。

常見問題

隨機性公平嗎?

它使用瀏覽器的隨機產生器,在範圍內均勻分布,用於抽獎、抽樣與測試都沒問題。

會抽到最大值嗎?

範圍包含你設定的上下界,因此最小值與最大值都可能被抽到。

我想打亂清單怎麼辦?

隨機抽選工具可打亂並從項目清單中挑選,這通常才是從姓名中抽獎所需要的。

數量與小數位數有什麼上限?

每次最多 1,000 個數字、最多 8 位小數,超過會被悄悄壓到上限。勾選「數值不重複」時,數量不能超過該範圍在所選精度下能有的相異值個數:在 1 到 10 之間要 20 個不重複的數字,只會顯示「請輸入有效數值。」,不會產生數字。

為什麼按下產生後什麼都沒發生?

最大值必須大於最小值。兩者相等或顛倒時,工具什麼都不做,畫面上原本的內容保持不變,也沒有錯誤訊息。把兩個值對調或改正後再按一次。

本站相關工具

以上步驟全部在這個頁面內完成,隨機數字產生器 不需要註冊、不上傳檔案、也不經過伺服器,關閉分頁後不會留下任何資料。