Random Integer Generator with Custom Ranges

Generate random numbers, flip a coin, or roll dice — all in one place. Free, secure, and runs entirely in your browser.

Updated:

Loading tool…

How to generate numbers, roll dice, and flip a coin

This free browser tool generates random integers, rolls dice, and flips a virtual coin on separate tabs. All three use Web Crypto with rejection sampling, with number-draw history, individual dice results and totals, and a coin streak counter.

Choose the Random Number tab to draw from an inclusive range. Set Min and Max to whole numbers, set Quantity, and click Generate. For a range from 1 to 10, both 1 and 10 can appear. Quantity controls how many independent draws appear in the result row, not the upper endpoint of the range. The interface allows a quantity between 1 and 100. Start with a small batch if you want to review each result before drawing again.

For a classroom with 30 numbered seats, set Min to 1 and Max to 30. A quantity of 1 picks one seat number; a quantity of 5 produces five draws from the same range. Those five draws can contain repeats. There is no Unique checkbox, exclusion list, or automatic removal of a result. If you need five different participants, use a named list with the Random List Picker and leave Allow duplicates off instead of assuming a number batch will be distinct.

The number generator saves its input settings in local storage when browser storage is available. The next visit can restore Min, Max, and Quantity, but it does not restore results or history. The history panel keeps the latest ten number batches in the current page session, with a local timestamp and the values from each batch. A new Generate action puts the newest batch first. Capture or copy anything important before refreshing, since there is no history download button on this tool.

Use finite whole-number bounds and keep the inclusive range width within JavaScript safe-integer limits. The draw routine rounds the lower bound up and the upper bound down before sampling an integer. Generate is disabled with a message when the rounded endpoints are not safe integers, the interval contains no integer, or its inclusive width exceeds the safe-integer limit. The same validation applies to settings restored from browser storage. Ordinary examples such as 1 to 6, 0 to 99, or -10 to 10 are easier to check and explain to others.

For a dice roll, switch to Dice Roller and choose one die type. The available options are D4, D6, D8, D10, D12, D20, and D100. Set Quantity from 1 to 20 and click Roll!. Every die in that batch uses the same selected type. The result shows the individual values and their total. There is no custom-sided die field, mixed-dice expression parser, keep-highest option, or automatic modifier field on this tab.

D6 means a six-sided die, so each result is an integer from 1 through 6. To roll two six-sided dice, choose D6 and set Quantity to 2. You will see two individual outcomes and their sum. To roll a twenty-sided check followed by an eight-sided value, make separate D20 and D8 rolls and keep your own record. Switching die types does not create a combined expression, and a new Roll! action replaces the displayed dice batch rather than appending a dice history.

The dice total is the sum of the individual faces, which is a different distribution from a single random number across the possible totals. For example, two D6 dice can total 2 through 12, but several different face pairs add up to 7 while only one pair adds up to 2. Use Dice Roller when the separate dice matter. Use Random Number if you intend every integer in a chosen interval to have the same chance. These are different selection rules even when the minimum and maximum outcomes look similar.

The Coin Flip tab has a Flip! button with Heads or Tails as the result. Each flip samples one of two equally likely outcomes through the shared random helper. The page displays the current consecutive streak, such as several Heads in a row. It does not display a full flip history, an all-time tally, or an export. A new result replaces the previous one, while the streak continues only if the outcome matches the preceding flip.

For a two-option decision, agree in advance which option means Heads and which means Tails. Press Flip! once and use the displayed result. Repeated flips are independent draws, so a long streak is not an instruction to expect the opposite face next. If you intend to use several flips for a classroom exercise, record results outside the page and decide how many observations to collect before starting. The streak counter alone does not tell you the frequency of each face across a whole session.

The shared helper asks crypto.getRandomValues for random data and rejects values above a usable range before taking the remainder. This avoids favoring some outputs merely because the source range does not divide evenly by your requested range. Number results, every die face, and coin results use this helper. It has no Math.random fallback for outcome selection. This describes the implementation of the draw, not an independent certificate that a participant list, event process, or saved screenshot is trustworthy.

Use a text picker when your inputs are names, tasks, menu items, or other labels rather than integers. The Random List Picker can pick several entries without replacement within one draw. The Random Wheel gives an audience an animated selection and offers an Eliminate mode for removing winners across spins. This number suite keeps its tabs focused on numeric ranges, matching dice, and a two-outcome coin, so it does not manage entrant eligibility or tournament brackets.

After the tool has loaded, draw handlers run in the browser and do not request results from a random-number server. A connection is still needed to load the application resources initially. Number settings can survive a refresh through local storage, but dice results, coin state, and number history are temporary. If storage is unavailable, the component catches settings-storage errors and still keeps the current settings in memory. Use an external record if you need reproducible notes about a session.

For a probability demonstration, decide whether you want a uniform integer, a sum of dice, or a binary result before choosing a tab. Keep the range and batch size fixed while collecting comparable observations. The interface shows individual results rather than computing long-run frequency charts, confidence intervals, or statistical tests. Copy the observations into your own worksheet if you need that analysis. Short runs can look uneven even when every draw uses the same selection rule, so do not treat a handful of results as a calibration test.

What this random number suite offers

  • Inclusive integer ranges with one to 100 results per number batch
  • Latest ten number batches retained during the current session
  • Seven fixed die types, including D100
  • One to 20 matching dice per roll with individual faces and a sum
  • Heads or Tails with a consecutive-outcome streak counter
  • Web Crypto rejection sampling for every outcome
  • Locally saved number settings when browser storage is available
  • Separate tabs for numeric sampling, dice, and a coin

Frequently Asked Questions

How do I generate a random number between 1 and 10?

Choose Random Number, enter 1 in Min and 10 in Max, and leave Quantity at 1 for a single draw. Click Generate to display an integer including either endpoint of that range. Increase Quantity if you want several independent draws at once, remembering that a batch can contain the same value more than once. The current session history keeps up to ten number batches so you can review earlier draws before leaving the page.

Can I generate numbers without repeats?

There is no unique-number mode in this component, and every number draw samples from the full range again. Increasing Quantity does not remove an earlier result from later draws in the same batch. If you need distinct numbered entries, enter those numbers as separate lines in the Random List Picker and leave Allow duplicates off. If you need winners removed between successive public spins, use the Random Wheel in Eliminate mode and review the entry list before starting.

Which dice are supported?

The dice selector offers D4, D6, D8, D10, D12, D20, and D100, and Quantity can be set from 1 to 20. One batch contains only the selected die type, with each face displayed separately and a sum below the results. To combine different die types, roll them in separate actions and record any earlier result before the next roll replaces it. A notation such as 2D6+3 is not parsed here; select D6, roll two dice, and apply any required adjustment yourself.

How do I roll one or two six-sided dice?

Open Dice Roller, select D6, choose Quantity 1 or 2, and click Roll!. A single D6 gives an integer from 1 through 6, while two D6 rolls display both faces and their total. Two dice can give totals between 2 and 12, but the possible totals are not equally likely because several face pairs can produce the same sum. Choose a single uniform integer range in Random Number instead if equal chances for each total are what you actually need.

Are Heads and Tails equally likely?

The coin result comes from secureRandomInt(2), which chooses between two values using the shared Web Crypto helper. The component maps one value to Heads and the other to Tails, without changing the odds based on previous outcomes. A streak tracks consecutive matching results for display only and does not influence the next flip. The page does not retain a complete coin history, so record individual flips elsewhere if you want to compare total counts over a session.

How does the random selection work?

The shared helper uses crypto.getRandomValues and rejection sampling to produce an integer below the requested bound. It rejects the unusable end of the source range before applying a remainder, which avoids modulo bias for ranges that do not divide the source range evenly. The number generator adds the lower endpoint, dice draws add one to a face index, and the coin maps a two-value result to a label. The helper requires a positive safe-integer bound and does not silently switch outcome generation to Math.random.

Can I use negative numbers or a range with equal endpoints?

A range of whole numbers can include negative values, such as -10 through 10. With equal whole-number endpoints, every result is that value because only one possible integer exists. Min must not exceed Max, and the inclusive range width must fit within the helper's safe-integer bound. Use whole numbers for a clear draw; fractional endpoints are rounded inward by the integer routine and are unsuitable if that leaves no integer in the interval.

What is saved when I close the page?

The component attempts to save Min, Max, and Quantity in local storage for this browser profile. It does not persist number results, the ten-batch session history, dice faces, coin results, or streak state. A refresh or a new visit therefore starts a fresh results session even if the old numeric settings return. Record the outcome externally before closing if you need it later, and do not assume that a saved setting is a saved record of the draw.

Can I use this on a phone or after disconnecting?

The draw handlers execute locally once the page and its required application code have loaded. You can use the same tabs and controls through a browser on your device without a separate installed application. Loading the page again still needs access to its resources, so keep the loaded tab available when you plan to disconnect. Device memory, browser capabilities, and storage permissions still apply, and the component does not provide an offline document archive or automatic session recovery.

Which tool should I use for selecting winners?

Use Random Number when each eligible choice already has a number and repeats are acceptable for your process. Use Random List Picker for named entries or a set of distinct entries selected together without replacement. Use Random Wheel when you want an animated presentation or need to remove the winning entry between spins. Whichever tool you choose, review duplicates and eligibility yourself and keep any records required by your event, since random selection alone does not validate those decisions.

By UtilDaily · Updated \u2014 free, privacy-first browser tools. No sign-up, no data collection.