GLOSSARY

What is a nonce?

A nonce is a unique value used once to prevent replay attacks and duplicate requests. Learn where nonces are used and generate one free.

A nonce ("number used once") is a value that must be unique for each use. It stops an attacker from replaying a captured request and stops a client from accidentally processing the same operation twice.

Preventing replay

If a request includes a fresh nonce that the server records and rejects on reuse, capturing and re-sending that request later does nothing — the server has already seen the nonce. This is how APIs defend against replay attacks and how payment/idempotency systems avoid double-charging.

Nonces in the wild

You will find nonces in OAuth flows, cryptographic protocols (where a nonce must never repeat with the same key), Content-Security-Policy script tags, and idempotency keys on APIs. A nonce just needs to be unique; a random token generator is a simple way to produce one.

Try it now — free, no signup

Use the token generator in your browser. Then, when you need it at scale with an API key and higher limits, grab the full Eveses API.

FAQ

Is a nonce the same as a token?›
A nonce is a token used exactly once. Many tokens are long-lived; a nonce’s whole point is single use.
How do I generate a nonce?›
Any unique value works — a random string from our token generator or a UUID are both common choices.

Related