Google Sheets generates random integers with the formula =RANDBETWEEN(min, max), where both endpoints are eligible, and produces random decimals between 0 and 1 with the parameterless =RAND() function. For a frozen list you can paste anywhere, you can also generate 1 to 1,000 integers at a time with the Random Number Generator and drop the comma-separated output into cell A1. The sheet-native formulas are volatile, so they recompute every time the workbook changes, which is useful for live models but a problem when you need stable test data or reproducible drawings. The browser tool, by contrast, captures a snapshot that survives edits, imports, and shared-view traffic. Negative bounds are supported by both, and a range containing only one value returns that value. Choose the method that matches whether you need the values to refresh with the workbook or to stay put once captured.
Most people searching for random numbers in Google Sheets fall into three buckets: teachers building practice worksheets, analysts generating sample or test data, and anyone running a small drawing or randomized selection. Each of those tasks has slightly different requirements around reproducibility, scale, and range, and the spreadsheet itself is rarely the best place to produce the numbers — Sheets is excellent at storing and analyzing them once they exist.

Built-in Google Sheets Functions for Random Numbers
Sheets has two native functions for random numbers and one helper that gives you more control over the range.
| Function | Output type | Range | Recomputes on edit? |
|---|---|---|---|
| =RAND() | Decimal | 0 (inclusive) to 1 (exclusive) | Yes |
| =RANDBETWEEN(low, high) | Integer | Inclusive low to inclusive high | Yes |
| =INT(RAND() * (max - min + 1)) + min | Integer | Inclusive min to inclusive max | Yes |
=RAND() takes no arguments and returns a fresh decimal every recalculation. =RANDBETWEEN(1, 100) returns one integer from 1 through 100 with both endpoints eligible. To force a value into a custom integer range without using RANDBETWEEN, wrap RAND in INT: =INT(RAND() * (50 - 10 + 1)) + 10 gives integers from 10 through 50 because INT truncates the decimal down to the nearest whole number before the +10 offset. All three formulas share the same drawback: they are volatile, so any edit anywhere in the workbook triggers a fresh draw and replaces your values.
How to Generate Random Numbers in Google Sheets: 3 Methods
These three methods cover almost every reason a Sheets user reaches for random numbers. Pick the one that matches whether you need the values to refresh with the workbook or to stay put once captured.
Method 1: Use RANDBETWEEN for a live, inclusive integer
- Click the cell where you want the first random integer.
- Type =RANDBETWEEN(1, 100) and press Enter; replace 1 with your minimum and 100 with your maximum.
- To fill a column, select the cell, grab the fill handle in the lower-right corner, and drag down or across for as many cells as you need.
- To lock the values, select the range, copy it, and use Paste Special → Values only; this stops the cells from rolling a new number on the next edit.
Method 2: Build a custom range with RAND and INT
- Click the destination cell.
- Type =INT(RAND() * (max - min + 1)) + min, substituting your minimum for min and your maximum for max.
- Press Enter, then drag the fill handle to repeat the formula across as many cells as you want.
- If you want a single decimal between two values instead of integers, use =RAND() * (max - min) + min.
Method 3: Generate a frozen list with the Random Number Generator and paste it in
- Open the Random Number Generator in a separate browser tab.
- Enter your minimum and maximum integers, set the count between 1 and 1,000, and choose whether duplicates are allowed.
- Click Generate numbers, then click into the output box and copy the comma-separated list.
- Switch back to Sheets, click cell A1, and paste; Sheets will spread each comma-separated value into its own cell across the row.
- To split the row into a column instead, use Data → Split text to columns with a comma as the separator, then transpose the row if needed.
Method 1 and Method 2 keep working whenever the workbook changes; Method 3 captures a snapshot that survives edits, imports, and shared-view traffic. If you need a column of stable test data or a frozen list of winning positions for a drawing, Method 3 is usually the safer choice.
How to Use the Random Number Generator Tool
The tool follows the same three-step flow whether you are filling one cell, one column, or a 1,000-row dataset.
- Enter the minimum and maximum safe integers. Both endpoints are eligible results, and negative bounds are supported.
- Choose a result count from 1 to 1,000 and decide whether duplicate numbers are allowed.
- Select Generate numbers, then review or copy the comma-separated output.
If you ask for more unique values than the inclusive range contains, the generator stops with a clear error instead of looping or silently returning fewer results. Asking for five unique integers from 1 through 3, for example, is rejected on the spot. Inputs are limited to JavaScript safe integers; decimals, blank fields, reversed bounds, infinity, and unsafe integers are also rejected. Changing any input clears the previous list so an old result is not mistaken for output from new settings, and a range containing only one value returns that value. Results appear as comma-separated integers that can be selected and copied with a single keyboard shortcut.
Why the Tool Produces Fair Results
Fairness in a random integer generator comes from two places: where the randomness comes from, and how raw random bits are mapped into the requested range. The Random Number Generator pulls entropy from the browser's Web Crypto interface (Crypto.getRandomValues on MDN) rather than Math.random, which is not designed for unpredictable draws. Raw random bits do not divide evenly into every target range, so the tool uses rejection sampling: it discards values from the incomplete tail of the modulo operation and draws again, which leaves each integer in the requested range with the same number of possible accepted raw values.
When duplicates are disabled, the tool runs a sparse partial Fisher–Yates shuffle to pick unique offsets without constructing an array for every integer in a potentially large range. The browser combines two 32-bit Web Crypto words into an exact 53-bit nonnegative integer before sampling, which avoids the precision loss you would get from a plain remainder operation. Each operation can return 1 through 1,000 numbers, and the validation step rejects non-integers, unsafe bounds, reversed ranges, inexact range sizes, and impossible unique requests before the draw begins.
Common Spreadsheet Tasks That Need Random Numbers
Random integers turn up in everyday Sheets work more often than people expect. A few concrete examples:
- Test data for charts and dashboards. Generate a column of 50 integers in the range 0 to 100 and use them as a fake daily count while you build a line or bar chart.
- Randomized order for a class roster. Assign each row a random integer with =RANDBETWEEN(1, 10000), then sort by that column to shuffle names without a third-party add-on.
- Quick drawings and giveaways. Pick one integer from 1 through the number of entries to find a single winner, then capture the result so it does not roll on the next edit.
- Sample selection from a dataset. Use =RANDBETWEEN(2, COUNTA(A2:A) + 1) to draw a random row position, then use INDEX or VLOOKUP to pull the matching record.
- A/B test buckets. Assign each user row a 0 or 1 with =RANDBETWEEN(0, 1) and use that flag to split traffic.
For sequential date ranges that you also want to load into Sheets, a related workflow covers date list creation in Google Sheets with the same spreadsheet-first mindset.
Limits and When to Choose a Different Tool
There are a few situations where Sheets-native formulas or this browser tool are not the right fit. If you need reproducible draws tied to a specific seed, neither RANDBETWEEN nor this tool will help — they both produce a fresh sample every time and offer no published seed, signed transcript, or external randomness beacon. If you need values wider than JavaScript safe integers, the browser cannot represent them exactly and you should switch to a system that accepts integer strings. If your task is regulated — a real lottery, a security token, a password, or a consequential access-control decision — this page is intentionally not designed for that, so follow the independently audited procedure your organization requires. The tool is a convenient general-purpose random integer generator, not a substitute for an audited lottery or cryptographic system.
Within ordinary spreadsheet work — test data, classroom drawings, sample picks, A/B flags, and ordering shuffles — the combination of RANDBETWEEN for live models and the Random Number Generator for frozen lists covers nearly every realistic case without leaving Sheets or your browser.