{ truly (random); }

Hardware random numbers in one HTTP call. Free, with no sign-up and no API key.

Intel & AMD RDRAND CORS enabled Node.js · Kotlin · Rust · .NET OpenAPI & llms.txt

Try it

These buttons call the live API, exactly as your code would.

Results appear here.
curl -d length=32 https://rdrand.com/API/GenerateKey

Just for fun

Two more endpoints, from the same hardware generator. Like GenerateUInt, they take a POST with an empty body.

Flip a coin

Heads or tails?
curl -d "" https://rdrand.com/API/FlipCoin

Magic 8 Ball

Ask a question
curl -d "" https://rdrand.com/API/Magic8Ball

API

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.

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…

POST/API/GenerateBytes

Random bytes, encoded as standard base64 with padding.

length
bytes, 0 to 16,777,216
returns
q83vEjRWeJA=

POST/API/GenerateUInt

A random integer that fits both signed and unsigned 32-bit types.

length
not used
returns
0 to 2147483647
  • Base URL https://rdrand.com/API/. Endpoints accept POST only.
  • Errors: a missing, non-numeric, negative or too-large length returns HTTP 500 with an HTML error page.
  • Browsers: CORS is open. Every response, errors included, carries Access-Control-Allow-Origin: *, and preflights are answered, so fetch works with form data or JSON.
  • Just for fun: POST /API/FlipCoin returns Heads or Tails, and POST /API/Magic8Ball returns one of the 20 classic answers. Try them.
  • Machine-readable: OpenAPI 3.1, llms.txt and full docs in Markdown.

Examples

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

Client libraries

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.

Questions

Where do the numbers come from?

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.

Do I need an account or API key?

No. Just send the request. Older examples passed an apiKey parameter; it is accepted and ignored.

Are there limits?

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.

Can AI agents and LLMs use it?

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.