Magic Tools
Utility GuidesBy CooconApril 22, 2026159 views6 min read

Random Number Generator: Generate Numbers in Any Range with Custom Step and Bulk Mode

What is a Random Number Generator?

A Random Number Generator (RNG) is a tool that produces numbers that lack any predictable pattern within a defined range. MagicTools Random Number Generator lets you specify a minimum value, maximum value, quantity, step increment, and uniqueness constraint — then instantly generates results. Random numbers are fundamental to games, simulations, statistical sampling, security protocols, and everyday decision-making. Unlike spreadsheet functions that require complex formulas, this tool provides a dedicated, easy-to-use interface for generating exactly the numbers you need in seconds.

Key Features

  • Custom Range: Set any minimum and maximum value — including negative numbers and large ranges
  • Multiple Results: Generate 1 to 10,000 random numbers at once
  • Unique Mode: Ensures no duplicate values appear in the output (no-replacement sampling)
  • Custom Step: Define a step increment so all results are multiples of a specific value (e.g., multiples of 5, even numbers only)
  • Copy All Results: Copy the entire list of generated numbers with one click
  • Instant Generation: Results appear immediately without page reloads

How to Use the Random Number Generator — Step by Step

Step 1: Set Your Range

Navigate to tools.cooconsbit.com/tools/random-number and enter your minimum and maximum values. Examples:

  • Simulating a dice roll: min = 1, max = 6
  • Selecting a random percentage: min = 0, max = 100
  • Picking a lottery number: min = 1, max = 49
  • Generating a negative random temperature: min = -30, max = 50

Step 2: Configure Options

Adjust the optional settings to match your requirements:

  • Quantity: Enter how many numbers you want. For a single result, keep it at 1. For generating 50 raffle ticket numbers, set it to 50.
  • Unique (No Duplicates): Enable this checkbox to ensure each generated number appears only once in the results. This is essential for drawing-style selection (lottery, raffle, team selection).
  • Step: Set a step value to constrain results to specific intervals. Step = 2 with min = 0 generates only even numbers. Step = 10 generates multiples of 10.

Step 3: Generate and Use the Results

Click Generate to produce the random numbers. The results appear in a list below. Click Copy All to copy every number to your clipboard, or select individual numbers manually. Paste the results into your spreadsheet, app, game, or document as needed.

Common Use Cases

Lottery, Raffle, and Prize Draws

Organizing a raffle or lucky draw? Generate a set of unique random numbers corresponding to ticket IDs. Enable the Unique mode to guarantee no ticket number is selected twice, ensuring a fair draw. Set the range to match your ticket numbering system and quantity to the number of prizes.

Board Games, Tabletop RPGs, and Dice Simulation

Tabletop gamers and game masters often need to simulate dice rolls beyond standard polyhedral dice — or roll many dice at once. Generate 10 × d6 rolls (min = 1, max = 6, quantity = 10) in a single click. Need a d100 percentile roll? Set min = 1, max = 100, quantity = 1. For custom dice used in homebrew games, set any range.

Statistical Sampling and Research

Researchers conducting surveys or experiments often need to select a random sample from a population. If your dataset has 5,000 entries, generate 200 unique random numbers between 1 and 5,000 to select which entries to include in your sample. Enable Unique mode to ensure each entry has an equal chance and is not selected twice.

Classroom Activities and Teaching

Teachers use random number generators to call on students (generate a number matching a student roster), randomly assign seats, pick discussion topics, or create randomized quiz questions. Generate the needed quantity instantly without the bias of manual selection.

Programming and Algorithm Testing

Developers testing sorting algorithms, data structures, or statistical functions need input arrays of random numbers. Generate a batch of 1,000 random numbers in a specified range, copy the list, and paste it directly into test code or a data file.

Decision Making and Games

When facing a choice between equally appealing options, assign each option a number and let the generator decide. Classic examples include splitting a dinner bill randomly, determining turn order in a group game, or picking a movie to watch from a shortlist.

Frequently Asked Questions

How random are the generated numbers?

The generator uses JavaScript's Math.random() function, which is a pseudo-random number generator (PRNG) based on algorithms like xorshift128+. It produces statistically random distributions suitable for games, sampling, simulations, and most everyday use cases. It is not a cryptographically secure RNG — for security-sensitive applications (encryption keys, tokens), use a dedicated cryptographic tool.

What is the difference between random with and without replacement?

With replacement (duplicates allowed) means each number is selected independently from the full range, so the same value can appear multiple times. Without replacement (unique mode) means each selected number is removed from the pool before the next selection, ensuring all results are distinct. Use unique mode for lotteries, raffles, and sampling without replacement.

Can I generate decimal (floating-point) numbers?

The current version generates integers only. For decimal numbers, you can use a workaround: multiply your desired range by a power of 10 (e.g., to get numbers between 1.0 and 10.0 with one decimal place, generate integers between 10 and 100, then divide by 10).

What happens if I set a step that is incompatible with my range?

If your step size does not evenly divide the range, the generator will produce values that are step-aligned starting from the minimum value. For example, with min = 0, max = 10, step = 3, possible values are 0, 3, 6, 9. Values that would exceed the maximum (12 in this case) are excluded.

Is there a limit to how many numbers I can generate at once?

The tool supports generating up to 10,000 numbers in a single operation. For unique mode, the limit is capped by the available numbers in your range — you cannot generate more unique values than exist between your minimum and maximum with your step setting.

Why Use MagicTools Random Number Generator?

MagicTools Random Number Generator is completely free, requires no sign-up or installation, and runs instantly in any browser. Its support for bulk generation, unique mode, and custom step increments makes it far more versatile than simple single-number generators, while the clean interface keeps it accessible for users of all technical levels. Whether you need a single dice roll or a thousand unique sample IDs, this tool handles it effortlessly.

Try it now at tools.cooconsbit.com/tools/random-number

Related Articles

Blocking rm -rf in Claude Code: A Deny Rule Stopped 14 Deletes in Two Weeks, 7 Other Spellings Still Get Through, and a Hook That Closes the Gap

To keep Claude Code from deleting things by accident, I added a deny rule, Bash(rm -rf *), to my global settings. Across my sessions from October 7 to 21 it blocked 14 deletes. After each denial the model picked a new directory name 8 times and dropped the delete 6 times. It never tried another spelling. Then I replayed 22 delete commands verbatim against Claude Code 2.1.285 through a stub. rm -fr, rm -r -f, rm -Rf and rm -r deleted the directory in manual, auto and bypass mode alike. /bin/rm, find -delete and bash -c deleted it in manual and bypass mode. In auto mode, rm -fr inside the working directory skips the classifier because it 'would be allowed in acceptEdits mode'. A second, built-in dangerous-rm check fires on targets like $D/*, even in bypass mode, but loses track of a variable assignment when a heredoc comes earlier in the same command. The post ends with a PreToolUse hook that blocks every recursive spelling in all three modes and tells the model what to do instead.

claude-codehooks+5
pitfallsOct 21, 20268 min
208

The Self-Reinforcing Flywheel Is Harder Than It Looks: 40 Days of an LLM Auto-Tuning Loop

We ran an 'LLM proposes, code decides' auto-tuning loop on a daily WeChat newsletter for 40 days: 18 versions, 8 rollbacks. Three of those rollbacks overturned decisions a human had made, and one version whose knobs were identical to its parent still got rolled back. Using our real numbers, telling apart a 20% difference needs about 25,000 reads per version. At 60 reads a day, that is more than 400 days. This postmortem covers five reasons the flywheel never turned, and what actually moved the numbers.

wechatpostmortem+4
pitfallsOct 21, 20268 min
133

Dev Breakfast · 2026-10-21

Today's headline: A single "bonsoir, Elliot" makes the model leak its .env: a backdoor for under $50. Plus 4 more: DeepSeek open-sources its inference engine: V4.1 Flash only, and KV cache still missing; TorchTPU goes open source: PyTorch models can run directly on TPU; and more.

daily-intelOct 21, 20268 min
446

Dev Breakfast · 2026-10-20

Today's headline: Should You Merge AI Code You Don't Understand: Settle the Abstraction Layer Yourself First. Plus 4 more: tmux as a Remote Control: Multi-Session Claude Code and send-keys; headroom Goes Open Source: 95% Token Savings on JSON, Only 20% for Coding Agents; and more.

daily-intelOct 20, 20265 min
415

Published by Magic Tools