Random number generator | Generate Random Numbers Instantly
Use our Random Number Generator to create unique numbers within a specified range, with options for repeats. Ideal for games, lotteries, or random selections. Reliable and versatile number generation.
What Is a Random Number Generator?
A random number generator (RNG) produces unpredictable numbers within a range you choose. This tool uses your browser’s cryptographically secure generator, so results are suitable for games, raffles, sampling, passwords and simulations. You can allow or forbid duplicates and set any minimum and maximum.
Use this tool from your AI agent
Free JSON API and Model Context Protocol (MCP) server. No signup, no API key, CORS open. Designed for Claude, ChatGPT, Cursor, scripts and frontend apps.
curl -X POST https://mate.tools/api/v1/random-gen.php \
-H "Content-Type: application/json" \
-d '{"mode":"number","min":1,"max":100,"count":5}' import urllib.request, json
req = urllib.request.Request(
"https://mate.tools/api/v1/random-gen.php",
data=json.dumps({"mode":"number","min":1,"max":100,"count":5}).encode(),
headers={"Content-Type": "application/json"},
)
with urllib.request.urlopen(req) as r:
print(json.load(r)) const r = await fetch("https://mate.tools/api/v1/random-gen.php", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({"mode":"number","min":1,"max":100,"count":5}),
});
console.log(await r.json()); Add to claude_desktop_config.json (Claude Desktop), ~/.cursor/mcp.json (Cursor), or any other MCP-compatible client:
{
"mcpServers": {
"mate-tools": {
"command": "npx",
"args": ["-y", "@mate-tools/mcp-server"]
}
}
} Frequently Asked Questions
The generator runs on the server and uses PHP's cryptographically secure random_int() function for high-quality randomness. While not "true" random (which requires physical phenomena), the numbers are statistically random and suitable for most applications including games, sampling, and testing.
When "Include Limits" is enabled, the boundary values (lower and upper limits) can appear in the results. For example, with range 1-10, both 1 and 10 can be generated. When disabled, only values strictly between the limits are generated.
When "Allow Duplicates" is disabled, you cannot request more numbers than exist in your range. For example, if your range is 1-10, you can only generate up to 10 unique numbers. Enable "Allow Duplicates" if you need more numbers than your range size.