UUID Generator API

Free, no authentication, CORS enabled. JSON by default, plain text on request. 60 requests per minute per IP.

Quick start

curl https://uuidtools.com/api/generate/v4
curl https://uuidtools.com/api/generate/v7?count=5&format=text
curl https://uuidtools.com/api/decode/b01eb720-171a-11ea-b949-73c91bba743d

All endpoints accept GET only. Generation endpoints return a JSON array of strings by default. Add ?format=text (or send Accept: text/plain) to get one UUID per line, ready for shell scripts.

Generate

GET /api/generate/{version} where version is one of v1 v2 v4 v6 v7 v8 nil max timestamp-first. (v3 and v5 are name-based.)

ParameterDefaultDescription
count11 to 1,000. Also available as a path: /api/generate/v4/count/10. Ignored for nil and max.
formatjsonjson or text.
upper01 for uppercase.
hyphens10 removes the hyphens.
braces01 wraps in {} (Microsoft GUID registry style).
urn01 prefixes urn:uuid:.
quotesnonedouble or single.
separatornewlineText format only: newline, comma, comma-space, space.

Examples

# 3 random UUIDs
curl "https://uuidtools.com/api/generate/v4?count=3"
# A GUID, Microsoft style
curl "https://uuidtools.com/api/generate/v4?upper=1&braces=1&format=text"
# 10 time-ordered UUIDs as a quoted, comma-separated list
curl "https://uuidtools.com/api/generate/v7?count=10&format=text&quotes=single&separator=comma-space"

Every UUID version is documented on its own generator page: v4, v7, v1, v6, v8, nil, max.

Privacy: v1, v2 and v6 UUIDs use a random node ID with the multicast bit set, never our server's MAC address.

Name-based UUIDs (v3 and v5)

The same namespace and name always return the same UUID, so count does not apply.

https://uuidtools.com/api/generate/v5?namespace=ns:dns&name=example.com
https://uuidtools.com/api/generate/v3/namespace/ns:url/name/https://www.example.com/
  • namespace: a UUID, or ns:DNS, ns:URL, ns:OID, ns:X500 (case-insensitive).
  • name: any text. The name is hashed as UTF-8 bytes, the same as Python, Java, Go and .NET (Encoding.UTF8). The same input produces the same UUID in all of them.
  • Prefix the name with base64: to send it base64-encoded. Use this for names containing / ? # % or non-ASCII text. Standard and URL-safe base64 are both accepted.
https://uuidtools.com/api/generate/v5?namespace=ns:dns&name=base64:RnJhbsOnYWlz

The example above is the UTF-8 encoding of Français. Earlier versions of this site hashed non-ASCII names using Latin-1 or failed on characters outside it (issue #55); that is fixed.

Decode and validate

GET /api/decode/{uuid} returns everything encoded in a UUID. It accepts hyphenated, bare 32-digit, {braces} and urn:uuid: forms in any case, and never errors on a well-formed UUID, including nil, max, unknown versions and legacy variants. Invalid input returns HTTP 400.

https://uuidtools.com/api/decode/b01eb720-171a-11ea-b949-73c91bba743d
{
  "valid": true,
  "uuid": "b01eb720-171a-11ea-b949-73c91bba743d",
  "version": 1,
  "version_name": "Gregorian time-based",
  "variant": "RFC 9562 (formerly RFC 4122 / DCE 1.1)",
  "variant_bits": "10",
  "is_nil": false,
  "is_max": false,
  "time": {
    "iso8601": "2019-12-05T04:49:57.9612960Z",
    "unix_seconds": 1575521397,
    "precision": "Exact to 100 nanoseconds"
  },
  "clock_sequence": 14665,
  "node": { "mac": "73:c9:1b:ba:74:3d", "multicast_bit": true },
  "sortable_by_time": false,
  "formats": { "standard": "...", "uppercase": "...", "braces": "...", "urn": "...", "hex": "...", "base64": "...", "integer": "..." },
  "fields": [ { "name": "time_low", "hex": "b01eb720", "description": "..." } ],
  "notes": [ "..." ]
}

The time object is present for versions 1, 2, 6 and 7. The legacy encode and decode objects from the previous API are still included for backward compatibility.

GET /api/validate/{uuid} is a lightweight check that always returns HTTP 200: {"valid": true, "version": 4, ...} or {"valid": false}.

Errors and limits

  • 400 invalid parameters, with {"message": "...", "errors": {"field": ["..."]}}.
  • 404 unknown version.
  • 429 more than 60 requests per minute from one IP. Check the Retry-After header. Need many UUIDs? Ask for up to 1,000 per request, or generate locally with your language's UUID library.

CORS

The API sends Access-Control-Allow-Origin: *, so you can call it from any website. If you use it, please link back to us.

const [uuid] = await (await fetch('https://uuidtools.com/api/generate/v7')).json();