What does the random number generator do?
Generates random integers or decimals within a custom min/max range using Web Crypto when available. Supports unique sets, dice, coin flips, and list picks — all in your browser.
Default mode uses the Web Crypto API (crypto.getRandomValues) with rejection sampling for unbiased integers when available. Toggle off for Math.random(). Not a certified lottery or hardware RNG—use audited services for regulated draws. For passwords and API keys, use the dedicated Password and API Key generators.
Skip to random number generatorSet a min/max range, pick integers or decimals, roll dice, flip coins, or pick from a list—cryptographically strong when your browser supports Web Crypto.
Lottery-style draw (no duplicates): 7, 15, 23, 38, 44 — illustrative sample. Live runs use your browser's crypto.getRandomValues() with rejection sampling when available.
Set range, quantity, integer or decimal mode, then generate in the tool below. For secure tokens or UUIDs, use the Random String Generator or UUID Generator.
Need secure tokens or UUIDs instead of numbers?
Random String →UUID Generator →Web Crypto unavailable; falling back to Math.random().
Informal raffles and games only. Not a certified lottery service or substitute for hardware RNG / audited drawings. Passwords and API secrets: use Password Generator or API Key Generator.
A random number generator (RNG) produces numbers with no predictable pattern. This tool uses the Web Crypto API (crypto.getRandomValues) with rejection sampling when available, or Math.random() as a fallback—supporting integers, decimals, dice, coin flips, and list picks in your browser.
Random number generators fall into two broad categories:
**Pseudorandom number generators (PRNG)**: Use a deterministic algorithm with a seed value. Given the same seed, they produce the same sequence — not truly random, but statistically unpredictable for practical purposes. JavaScript's Math.random() is a PRNG.
**Cryptographically secure PRNGs (CSPRNG)**: Use additional entropy sources (hardware events, system entropy) to ensure outputs cannot be predicted even with knowledge of the algorithm. The Web Crypto API's crypto.getRandomValues() is cryptographically secure and available in all modern browsers.
This tool defaults to Web Crypto with rejection sampling so every integer in your range has equal probability (avoiding naive modulo bias). You can switch to Math.random() for speed in non-sensitive simulations.
This tool generates:
Concise answers for common searches — definitions, steps, and comparisons.
Generates random integers or decimals within a custom min/max range using Web Crypto when available. Supports unique sets, dice, coin flips, and list picks — all in your browser.
Yes — numbers are generated locally in your browser. Range settings and results are not uploaded to EverydayTools servers.
Enter the lower and upper bounds of your range. The range can include negative numbers (e.g., min: -100, max: 100). For a standard 1–100 range, enter 1 and 100—or tap a preset.
Choose how many random numbers to generate. If duplicates are disabled, the count cannot exceed the range size (max − min + 1) — the tool will show a warning if you request more than is possible.
Integer mode generates whole numbers. Decimal mode generates floating-point numbers — set the number of decimal places (0–10) for the precision you need.
Numbers appear as chips. Copy, copy as lines, download CSV, or share a settings link. Use Dice, Coin, or List picker tabs for those workflows.
Common real-world scenarios where this tool saves time.
Generate random integers for test data, boundary value analysis, fuzz testing inputs, or populating seed data in development databases.
Roll NdM dice, flip coins, draw random cards, or generate simulation parameters without writing code.
Pick a random winner from numbered entries (1–N), use the list picker for names, or sample a subset from a numbered list.
Demonstrate probability concepts by generating large samples — count occurrences of each value and observe how distributions converge with larger N.
Office draws and classroom picks are fine. For regulated lotteries or prize draws with financial stakes, use a certified / notarized randomness service.
Step-by-step chains that connect related tools for common tasks.
Use random numbers to populate test inputs for software testing.
Pick a winner from numbered entries without bias.
Input
Min: 1 · Max: 49 · Quantity: 5 · Duplicates: offOutput
e.g. 7, 15, 23, 38, 44With duplicates disabled, each number is drawn once — like balls in a lottery drum. The count (5) must be ≤ range size (49), which it is.
Input
Min: 0 · Max: 1 · Quantity: 1 · Decimal: 4 placesOutput
e.g. 0.7341A uniform random float between 0 and 1 is the foundation of most probability simulations — compare against a threshold (e.g., 0.7 = 70% probability event).
The two main random number APIs in browsers — choosing the right one for your use case.
| Feature | Math.random() | crypto.getRandomValues() |
|---|---|---|
| Type | PRNG (pseudorandom) | CSPRNG (cryptographically secure) |
| Speed | Very fast | Slightly slower |
| Predictability | Statistically unpredictable | Cryptographically unpredictable |
| Use case | Games, simulations, testing | Tokens, secure draws, security-sensitive picks |
| Browser support | All browsers | All modern browsers |
| Suitable for security | No | Yes (for most applications) |
This tool defaults to crypto.getRandomValues() with an optional Math.random() fallback. Use Password / API Key generators for production secrets.
Which randomness approach matches different needs.
| Use case | Security requirement | Recommended approach |
|---|---|---|
| Dice roll / game | Low | Web Crypto or Math.random() ✓ |
| Test data generation | Low | Web Crypto or Math.random() ✓ |
| Random survey sample | Low–Medium | Web Crypto ✓ |
| Temporary password / token | High | Password / API Key generators |
| Cryptographic key material | Very high | Dedicated crypto library / HSM |
| Regulated lottery / gambling | Certified | Hardware RNG + audit |
Never use browser Math.random() alone for security credentials.
By default the tool uses crypto.getRandomValues() (Web Crypto CSPRNG) with rejection sampling so integers in your range are unbiased. You can turn off “Prefer Web Crypto” to use Math.random() instead. Neither replaces certified hardware RNG for regulated gambling.
Yes — disable the 'Allow duplicates' option. The tool then draws numbers without replacement, like a lottery draw. The count you request cannot exceed the number of unique values in the range (max − min + 1). For example, generating 10 unique numbers from the range 1–5 is impossible and will produce a warning.
The tool supports any range where min and max are valid JavaScript numbers (up to ±2^53 − 1, or approximately ±9 quadrillion). Practically, ranges of millions to billions work fine for generating integers or decimals.
Yes. Set a negative minimum value, such as min: −100 and max: 100. The generator will produce numbers anywhere in that range, including negative values.
A random number generator produces numbers within a specified numeric range (e.g., 1–100). A UUID generator produces 128-bit universally unique identifiers in hex format (e.g., 550e8400-e29b-41d4-a716-446655440000), designed for use as database keys, session IDs, and distributed system identifiers — not numeric values.
For informal raffles or office draws, yes — the unpredictability is sufficient. For regulated lotteries, legal gambling, or prize draws with financial stakes, use certified random number hardware or a notarized randomness service, as these require verifiable and auditable randomness.
Decimal mode generates floating-point numbers. Precision sets how many decimal places appear in the result: 1 decimal = X.X, 2 decimals = X.XX, 3 = X.XXX, etc. For example, a range 0–1 with precision 4 might generate 0.7423.
Yes — all random number generation runs locally in your browser. The range, quantity, and generated values are not sent to EverydayTools servers. History stays in localStorage on your device.
All random number generation runs in your browser. Range inputs and generated values are not sent to EverydayTools servers. Optional history uses localStorage only.
Not suitable as a certified lottery service or sole source for cryptographic key material. For passwords and API keys use dedicated generators. Regulated gambling requires audited RNG.
Advertisement
Reviewed by EverydayTools Editorial Team on 2026-07-10.
Same workflow or intent — pick the next step without leaving the site.
Free UUID generator: v4, v7 & v1 GUIDs in your browser—bulk up to 1,000, validate, export JSON/CSV. crypto.randomUUID; never uploaded.
Free .env file parser — paste any .env file and extract all environment variables as structured JSON or YAML. Useful for config migration and debugging. No signup needed. Runs locally in your browser when supported—no upload required for normal use.
Generate cryptographically secure random API keys in hex, base64, or alphanumeric format — instantly in your browser with no upload, no signup.
Free API mock generator — create realistic mock API responses with custom status codes, response headers, and JSON body. Perfect for frontend development and testing. No signup. Runs locally in your browser when supported—no upload required for normal use.
Free number base converter — convert between binary (base 2), octal (base 8), decimal (base 10), hexadecimal (base 16), and text in real time. No signup required. Runs locally in your browser when supported—no upload required for normal use.
Free browser info checker — see user agent, screen size, viewport, DPR, language, and timezone instantly in your browser. Nothing is uploaded; data stays on your device.
Frequently opened tools from the same category.
Free JSON formatter — paste minified or messy JSON and instantly get beautified, indented output with syntax highlighting and error detection. Browser-based, no server upload. Runs locally in your browser when supported—no upload required for normal use.
Free JSON diff & compare — structural side-by-side diff, ignore paths, array modes, RFC 6902 patch and merge patch export. Runs locally in your browser—no upload.
Free UUID generator: v4, v7 & v1 GUIDs in your browser—bulk up to 1,000, validate, export JSON/CSV. crypto.randomUUID; never uploaded.
Free .env file parser — paste any .env file and extract all environment variables as structured JSON or YAML. Useful for config migration and debugging. No signup needed. Runs locally in your browser when supported—no upload required for normal use.
Guides and walkthroughs that reference this tool.
Step-by-step guide to calculating your calorie deficit for weight loss using the Mifflin-St Jeor equation and TDEE. Includes BMR formulas, activity multipliers, macro targets, and a free browser-based calorie calculator.
What regex is, how pattern syntax maps to real strings, and where to use it for validation, search-replace, and log parsing—with a quick reference.
Browse full tool collections by topic.