Idempotency Key Generator
Generate free UUID v4/v7 idempotency keys, singly or in batches of 100. Copy header, cURL and fetch examples or export TXT/CSV. No sign-up; runs in your browser.
🔒 This tool runs entirely in your browser. Your files are never uploaded to a server.
Letters, numbers, _ - . only · up to 32 characters.
Generated locally in your browser using cryptographically secure randomness. Nothing is uploaded. A prefix is a plain label — it adds no uniqueness or security.
Developer usage
Examples use the first generated key
Send the same Idempotency-Key when you retry the same operation; use a new key for a new operation. This tool only generates keys — your API does the idempotency handling. The endpoint below is a placeholder, not a real service.
Idempotency-Key header example
For an API that accepts this header, send one generated key with the initial request and keep it for retries of that same operation.
Idempotency-Key: 6cdd1f6b-6f5b-4c4a-9a1e-b0e63d5a27f8 This fixed value illustrates the format. Generate your own key above. If the request times out, reuse your saved key with the same parameters according to the API's retry policy. A new operation needs a new key.
How to generate an idempotency key
- Choose UUID v4 for a random identifier, or UUID v7 if a timestamp-based identifier suits your application.
- Optionally add a prefix of up to 32 letters, numbers, underscores, hyphens or periods. Include your own separator, such as payment_. A prefixed value is no longer a bare UUID.
- Select 1, 5, 10, 25, 50 or 100 keys. Copy the output; TXT and CSV downloads are available for batches of more than one key.
- Use the copyable header, cURL or JavaScript example as a starting point. Replace the placeholder endpoint, add the required authentication and request fields, and follow your API's idempotency format.
- Save the key with the logical operation before making the first request. Keep that key for retries; do not generate another key simply because a response timed out.
One operation, one saved key
Suppose you submit an order and the connection drops before the response arrives. The server may already have completed the operation. A retry using the original key lets a supporting API recognize the same operation. A fresh key may instead allow it to process another request.
This generator creates identifiers only. It does not send requests, track operations, store server responses or implement duplicate-request handling. The receiving API controls how keys are scoped, how long they are retained and what happens when parameters differ.
FAQ
What is an idempotency key?
It is a client-supplied identifier that a supporting API uses to recognize repeated attempts at the same logical operation. A UUID is a convenient identifier format, but the API must implement the handling that makes retries idempotent.
Should I choose UUID v4 or UUID v7?
UUID v4 uses random bits apart from its version and variant fields. UUID v7 includes a millisecond timestamp plus random bits in this implementation. Choose v4 for a straightforward random key; choose v7 when approximate creation-time ordering is useful. Keys created in the same millisecond are not guaranteed to sort in generation order here.
Can I use this generator for Stripe idempotency keys?
Stripe recommends UUID v4 or another sufficiently random string and accepts keys up to 255 characters. An unprefixed UUID v4 from this tool is 36 characters. Check Stripe's documentation for request support, parameter matching and retention; a key is not a permanent duplicate-prevention guarantee.
Do all APIs use the Idempotency-Key header?
No. Stripe supports that header, while Square uses an idempotency_key request field on relevant endpoints. Other APIs may use different fields or limits. The examples here are generic starting points, not requests ready for every provider.
Should a retry use the same key and request body?
Reuse the key for the same operation with the same parameters, within the provider's retry rules. For a new operation, generate a new key. Providers can reject reuse with changed parameters. Keep the original key outside this page so regeneration or reloading does not lose it.
Can I generate and download a batch?
Yes. Choose up to 100 keys. Copy all keys or download the current batch as TXT or CSV. Exports use the displayed keys rather than generating replacements. Developer examples use the first key in a batch.
What does the optional prefix do?
It adds a label directly before the UUID, without automatically adding a separator. The allowed prefix length is 32 characters, making the longest output 68 characters. A prefix adds no randomness and may violate APIs that require a bare UUID or a shorter key, so check the endpoint's rules.
Are the generated keys stored or uploaded?
Generation uses the browser's cryptographic random facilities and the widget does not upload or persist the generated keys. Copy or export keys you need to retain. Changing the type, batch size or committed prefix generates new output.
API documentation and related tools
Check Stripe's idempotent request documentation or Square's idempotency guide for the required field, length limits and retry behavior. UUID formats are defined in RFC 9562.
Read our idempotency key guide, or use the UUID generator for general identifiers.