Free Random Number Generator

Generate cryptographically secure random integers, floats, unique sets, and Gaussian distribution samples — entirely in your browser using crypto.getRandomValues(). Nothing is ever sent to a server.

Generate a single cryptographically secure random integer or floating-point number within any range. Uses bias-free rejection sampling — every value is equally probable.

Result
All generation in your browser Uses crypto.getRandomValues() Nothing sent to a server
Quick Presets
Show
Generation History
Show
No history yet — generate some numbers above.
100% client-side — no server contact
Cryptographically secure randomness
Free, no sign-up needed

What This Random Number Generator Does

Four modes cover every numeric generation scenario. Single mode generates one integer or float within any range using bias-free rejection sampling. Set mode generates a batch of integers — optionally unique (sampling without replacement via Fisher-Yates shuffle) and sorted. Gaussian mode generates samples from a normal distribution defined by mean and standard deviation using the Box-Muller transform, with optional clamping to a physical range. List mode randomly picks or shuffles string items you supply — environment labels, usernames, server names, or any other values.

Quick Presets above the history panel load common configurations in one click — standard normal, IQ distribution, latency simulation, random ports — and trigger generation immediately. Generation History records your last 10 outputs with timestamps for easy reference. All randomness uses crypto.getRandomValues() and nothing leaves your browser. Multi-value results include a Download .txt button for importing directly into test fixtures, seed files, and simulation inputs.

Tips for Getting the Best Results

Frequently Asked Questions

Is this truly random or pseudo-random?

This tool uses crypto.getRandomValues() — the browser's Cryptographically Secure Pseudo-Random Number Generator (CSPRNG), seeded from hardware entropy sources including CPU timing jitter, system interrupts, network packet timing, and other physical events that cannot be predicted or reproduced by an observer. It is fundamentally different from Math.random(), which is a deterministic algorithm (typically xorshift128+ or a similar LCG variant) that produces a reproducible sequence from a known seed — making it entirely unsuitable for security-sensitive values or applications requiring statistical rigour.

The output of crypto.getRandomValues() is statistically indistinguishable from true randomness under standard cryptographic assumptions, and it is the same primitive used across our entire tool suite — Password Generator, UUID Generator, PIN Generator, and Secure Token Generator. You can verify that no network requests are made during generation by opening your browser's Developer Tools, navigating to the Network tab, and clicking Generate — the request log stays empty after the initial page load.

What is modulo bias and how does this tool avoid it?

Modulo bias is a subtle statistical flaw that occurs when you map a raw random integer to a smaller range using the modulo operator. crypto.getRandomValues() produces 32-bit unsigned integers uniformly distributed across the range 0–4,294,967,295 (2³² − 1). If you apply modulo to map this to a range of, say, 100 (yielding values 0–99), the issue is that 4,294,967,296 divided by 100 leaves a remainder of 96. This means values 0–95 can be produced by one more 32-bit value than values 96–99 — making them approximately 0.0000023% more likely. In practice this is tiny, but for cryptographic applications or rigorous sampling it represents a non-uniform distribution.

This tool uses rejection sampling to eliminate the bias entirely. It calculates the largest multiple of the target range that fits within 32 bits (floor(2³² / range) × range), then discards any raw value at or above this threshold and re-draws. Only values within the perfectly uniform portion of the 32-bit space are used. The expected number of extra draws needed is under 1 per call on average — the overhead is negligible in practice. The same approach is used in our PIN Generator and Password Generator for consistent statistical quality across all tools.

What is a Gaussian distribution and when should I use it?

A Gaussian distribution (also called a normal distribution or bell curve) describes a continuous probability distribution where values cluster symmetrically around a central mean (μ) and thin out at a rate determined by the standard deviation (σ). About 68.3% of samples fall within one σ of the mean, 95.4% within two σ, and 99.7% within three σ — this is the empirical rule. The distribution is characterised by being symmetric, unimodal, and having exponentially decaying tails in both directions.

This tool uses the Box-Muller transform to generate Gaussian samples from pairs of uniform random numbers produced by crypto.getRandomValues(). Developer use cases include: generating realistic API response latency test data (e.g. μ=120ms, σ=30ms to simulate a server with natural variance), creating synthetic A/B test populations with a known conversion rate and confidence interval, seeding test datasets that reflect the natural measurement noise of real sensor readings, Monte Carlo simulation inputs, validating statistical analysis code against datasets with known distribution parameters, and generating realistic user behaviour metrics for QA environments. The Clamp option handles physical constraints like preventing negative latencies or capping values at 100%.

What does the Clamp option do in Gaussian mode?

A Gaussian distribution has theoretically infinite tails — any value is possible, just increasingly unlikely as you move further from the mean. More than 3σ from the mean occurs only 0.3% of the time, but in a large sample set these outliers appear regularly and can cause problems when the modelled quantity has a physical constraint. For example, an API response time cannot be negative, a percentage cannot exceed 100, and a byte value must stay within 0–255.

The Clamp option truncates outputs to the specified minimum and maximum bounds. Values below the minimum are replaced by the minimum; values above the maximum are replaced by the maximum. This creates a slight concentration of probability mass at the clamp boundaries — technically equivalent to sampling from a truncated normal distribution. For most simulation purposes this is perfectly acceptable. If you need strict truncation without any boundary concentration, a common alternative is to generate samples and reject those outside the range (regenerating until you have enough valid samples), but for the typical use cases in testing and simulation, clamping is the right practical choice.

What is the unique number set useful for in development?

With "Unique (no repeats)" enabled in Set mode, numbers are drawn without replacement using a Fisher-Yates shuffle on the full range pool — every combination of N numbers from the range is equally likely, with no value appearing more than once. This is mathematically equivalent to shuffling the complete set of integers in the range and taking the first N elements. The resulting set has the same statistical properties as sampling without replacement, which is essential whenever you need guaranteed non-colliding values.

Practical developer uses include: generating non-colliding test user IDs to seed a staging database without primary key conflicts, picking random ports for parallel test runners that need to listen simultaneously (the unique guarantee means no port collision), selecting random database row offsets for representative sampling without selecting the same row twice, creating randomised feature flag assignment maps where each value represents a distinct experiment cohort, and generating test credit card numbers or phone numbers within a valid range for mock data. For unique string identifiers rather than numbers, our UUID / GUID Generator produces 122-bit collision-resistant values safe for distributed systems at any scale.

When should I use this over a UUID or token generator?

The choice depends on what you are trying to represent. Use this Random Number Generator when you need numeric values with a specific range or distribution for test data, simulations, index generation, or statistical sampling. The numeric output is directly usable in mathematical computations, can be bounded to a meaningful domain (latencies in milliseconds, ages in years, counts within system limits), and can follow a specific statistical distribution to model real-world phenomena.

Use our UUID / GUID Generator when you need globally unique opaque identifiers that will be stored as database primary keys, used in API resource URLs, or shared across distributed systems — UUID v4's 122-bit space makes collision probability negligible at any realistic scale. Use our Secure Token Generator for high-entropy strings used as API keys, session secrets, CSRF tokens, or JWT signing keys — these need to be computationally unpredictable, not just unique. Use our Password Generator for human-readable credentials that balance memorability with entropy. The underlying CSPRNG is identical across all tools — only the output format, range, and intended purpose differ.

What is the list picker useful for in a developer context?

List mode randomly selects or shuffles string items you provide, using the same Fisher-Yates shuffle algorithm as Set mode. Every permutation of the items is equally likely, and every selection of N items from the pool is equally likely — there is no statistical bias toward any position in the input list. The input can be entered one item per line or comma-separated, and the tool handles trimming and deduplication of the parsed items.

Developer uses include: randomly selecting a test environment from a pool (staging, canary, production, dev) to ensure your CI pipeline tests against all environments with equal frequency, picking a random feature flag variant for an experiment run, choosing which team member is assigned a task in an automated rotation script, shuffling test fixtures to detect order-dependent bugs in application code that processes lists, selecting random hostnames or IP addresses from a cluster definition for load testing, and picking random user agent strings for web scraping tests. With "Shuffle all items" enabled, the entire list is returned in a cryptographically random order — useful when you want a random permutation rather than a random selection, such as randomising the order of test cases or interview questions.

How does the Fisher-Yates shuffle work and why is it used?

The Fisher-Yates shuffle (also called the Knuth shuffle) is an algorithm that produces a uniformly random permutation of an array in O(n) time. Starting from the last element and working backwards, it swaps each element with a randomly chosen element at or before its current position (including itself). The result is that every possible ordering of the n elements is equally likely — there are n! (n factorial) possible permutations and each appears with probability 1/n!.

The naive approach of picking a random index for each position and retrying on collision produces subtly biased results and runs in potentially unbounded time for large arrays. Fisher-Yates avoids both problems. This tool uses it in both Set mode (to generate unique random integer sets by shuffling the full range and taking the first N elements) and List mode (to shuffle or pick from your custom list). The shuffle uses crypto.getRandomValues() with rejection sampling at each step to ensure the random index selection is itself unbiased, giving the strongest statistical guarantees available in a browser environment.

Can I use these random numbers for cryptographic purposes?

Individual random numbers from this tool are cryptographically secure in the sense that they are drawn from a CSPRNG seeded with hardware entropy — but the appropriate tool for cryptographic key material depends on the specific use case. For generating API keys, session tokens, and cryptographic secrets, use our Secure Token Generator, which produces hex, Base64 and URL-safe Base64 output at configurable byte lengths that directly correspond to entropy bits. For generating passwords with mixed character sets, use our Password Generator. For UUID-based identifiers, use our UUID Generator.

Random integers in a range are appropriate for cryptographic use cases where a numeric value is specifically required — for example, generating a random nonce within a protocol-defined range, selecting a random index for a PRNG seed table, or picking a random element from a small set for a cryptographic protocol. They are not appropriate as raw key material because the entropy is determined by the range size (log₂(max − min + 1) bits), which is typically far less than the 128–256 bits required for cryptographic keys. For all key material needs, use the Secure Token Generator which operates at the byte level rather than the integer level.