POST/API/GenerateKey
A random string drawn uniformly from the 63 characters 0-9 A-Z _ a-z. Useful for keys, tokens and IDs.
- length
- characters, 0 to 16,777,216
- returns
uE3_kq9ZLx0t…
Hardware random numbers in one HTTP call. Free, with no sign-up and no API key.
These buttons call the live API, exactly as your code would.
Two more endpoints, from the same hardware generator. Like GenerateUInt, they take a POST with an empty body.
curl -d "" https://rdrand.com/API/FlipCoin
Three endpoints. Send length as a form field, a JSON property or a query parameter. The response body is the value itself, as plain text.
A random string drawn uniformly from the 63 characters 0-9 A-Z _ a-z. Useful for keys, tokens and IDs.
uE3_kq9ZLx0t…Random bytes, encoded as standard base64 with padding.
q83vEjRWeJA=A random integer that fits both signed and unsigned 32-bit types.
0 to 2147483647https://rdrand.com/API/. Endpoints accept POST only.length returns HTTP 500 with an HTML error page.Access-Control-Allow-Origin: *, and preflights are answered, so fetch works with form data or JSON.POST /API/FlipCoin returns Heads or Tails, and POST /API/Magic8Ball returns one of the 20 classic answers. Try them.Call the REST API from anything that speaks HTTP, or use a client library. The libraries use your own CPU's hardware generator and call the API only when it has none.
curl -d length=32 https://rdrand.com/API/GenerateKey
curl -d length=16 https://rdrand.com/API/GenerateBytes | base64 --decode > random.bin
curl -d "" https://rdrand.com/API/GenerateUInt
const res = await fetch("https://rdrand.com/API/GenerateKey", {
method: "POST",
body: new URLSearchParams({ length: 32 }), // form data: no CORS preflight
});
const key = await res.text(); // 32 chars from 0-9 A-Z _ a-z
// jQuery
$.post("https://rdrand.com/API/GenerateBytes", { length: 16 }, (base64) => { /* ... */ });
$.post("https://rdrand.com/API/GenerateUInt", (n) => { /* 0 to 2147483647 */ });
import base64
import requests
API = "https://rdrand.com/API/"
key = requests.post(API + "GenerateKey", data={"length": 32}).text
raw = base64.b64decode(requests.post(API + "GenerateBytes", data={"length": 16}).text)
n = int(requests.post(API + "GenerateUInt").text)
// npm install https://rdrand.com/Downloads/jebtek-rdrand-2.0.0.tgz
const { RdRand } = require("@jebtek/rdrand");
const rng = new RdRand(); // CPU's RDRAND/RNDR, else the API
const key = await rng.generateKey(32);
const bytes = await rng.generateBytes(16); // Buffer
const n = await rng.generateUInt();
console.log(rng.source); // "rdrand", "rndr" or "service"
// implementation(files("libs/rdrand-kotlin-2.0.0.jar"))
import com.jebtek.rdrand.RdRand
val rng = RdRand() // CPU's RDRAND/RNDR, else the API
val key = rng.generateKey(32)
val bytes = rng.generateBytes(16)
val n = rng.generateUInt()
println(rng.source) // RDRAND, RNDR or SERVICE
// rdrand-client = { path = "rdrand-client-2.0.0" }
use rdrand_client::Client;
let rng = Client::new(); // CPU's RDRAND/RNDR, else the API
let key = rng.generate_key(32)?;
let bytes = rng.generate_bytes(16)?;
let n = rng.generate_uint()?;
println!("{}", rng.source().as_str()); // "rdrand", "rndr" or "service"
// dotnet add package JebteK.RdRand --source <folder with the .nupkg>
using JebteK.RdRand;
using var rng = new RdRandClient(); // CPU's RDRAND/RNDR, else the API
string key = await rng.GenerateKeyAsync(32);
byte[] bytes = await rng.GenerateBytesAsync(16);
uint n = await rng.GenerateUIntAsync();
Console.WriteLine(rng.Source); // Rdrand, Rndr or Service
// RdRandom-v1_1.zip: .NET Framework, requires RestSharp, API only
string key = RdRandom.Randomizer.GenerateKey(32);
byte[] bytes = RdRandom.Randomizer.GenerateBytes(16);
uint n = RdRandom.Randomizer.GenerateUInt();
Free under the MIT license. Each one asks your CPU first (RDRAND on Intel and AMD, RNDR on ARMv8.5+ such as AWS Graviton3) and falls back to the API. The formats are identical either way.
From the RDRAND instruction of the servers' Intel and AMD processors. RDRAND reads a hardware entropy source that is conditioned by AES and checked by the CPU. The service checks every draw's success flag, retries when the generator is momentarily busy, and rejects stuck values, so it never serves a failed read as a number.
No. Just send the request. Older examples passed an apiKey parameter; it is accepted and ignored.
length can be up to 16,777,216 per request. Please be considerate with request volume; for high volumes, the client libraries generate locally on your own CPU at no cost to anyone.
Yes. /llms.txt summarises the API, /llms-full.txt documents everything in Markdown, and /openapi.json is an OpenAPI 3.1 description that tool-calling frameworks can import directly.