Skip to main content

UUID & ID Generator API

MOCK DATA

Generate seed-reproducible UUIDs and compact IDs, or inspect any canonical UUID's RFC 9562 variant, version and UUIDv7 timestamp fields.

Generated test data for fixtures and development

Base URL
/api/uuids
Capabilities
2 routes Seedable
Last updated
July 29, 2026

GET /api/uuids

Live requestRuns against the public API
No key required
GET/api/uuids?seed=42

Request parameters

ID format: uuid4 (random RFC 9562 v4), uuid7 (v7 layout with a seed-derived timestamp), ulid (26-char Crockford base32), nanoid (URL-safe), or hex.

Output length in characters — applies to nanoid (default 21) and hex (default 64) only. The other formats are fixed-width; supplying it for them adds a warning.

Return values in uppercase. UUIDs and hex are lowercase by default; ULIDs are always uppercase.

Advanced response options7 options

How many records to generate (1–100).

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Response format: json envelope, ndjson (one record per line) or csv.

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/uuids?seed=42"
const res = await fetch("https://randomapi.dev/api/uuids?seed=42");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/uuids?seed=42").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/uuids?seed=42"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 3
type enum

ID format: uuid4 (random RFC 9562 v4), uuid7 (v7 layout with a seed-derived timestamp), ulid (26-char Crockford base32), nanoid (URL-safe), or hex.

default: uuid4
allowed: uuid4 | uuid7 | ulid | nanoid | hex
example: type=nanoid
length int

Output length in characters — applies to nanoid (default 21) and hex (default 64) only. The other formats are fixed-width; supplying it for them adds a warning.

allowed: 4 – 128
example: length=32
uppercase boolean

Return values in uppercase. UUIDs and hex are lowercase by default; ULIDs are always uppercase.

default: false
example: uppercase=true
Universal parameters Shared response and formatting options 7
count int

How many records to generate (1–100).

default: 10
allowed: 1 – 100
example: count=3
seed int

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

example: seed=42
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=value,type
exclude list

Return all fields except these (comma-separated).

example: exclude=type
format enum

Response format: json envelope, ndjson (one record per line) or csv.

default: json
allowed: json | ndjson | csv
example: format=csv
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 2
value string

The generated identifier in the requested format.

example: 3f8a2c4e-9b1d-4e6f-8a2c-5d7b9e1f3a6c

type string

The format of this value — echoes the type parameter.

example: uuid4

Documented examples

Build-generated requests and complete responses
5
Ten reproducible UUID v4s
GET /api/uuids?seed=42
{
  "data": [
    {
      "value": "7aad9951-8709-4268-87f1-b364a45dcc8b",
      "type": "uuid4"
    },
    {
      "value": "0a017286-fd2c-4986-a4bb-e6cdcab4aa63",
      "type": "uuid4"
    },
    {
      "value": "db1e5977-9001-4708-a5cd-0258a9c98133",
      "type": "uuid4"
    },
    {
      "value": "2795092d-f4d8-4f51-a3ed-11ebf426fef2",
      "type": "uuid4"
    },
    {
      "value": "d5b76f40-0cb3-4ce5-9a48-d388bb10d8a9",
      "type": "uuid4"
    },
    {
      "value": "04696147-067d-4fc2-bf4f-c4cebabb16f9",
      "type": "uuid4"
    },
    {
      "value": "15639dc0-8f64-4236-bd0c-6883072defca",
      "type": "uuid4"
    },
    {
      "value": "d5897be7-e07d-45aa-8601-d514fafa2eef",
      "type": "uuid4"
    },
    {
      "value": "7403ab1a-b379-440e-afe8-b377412de1ca",
      "type": "uuid4"
    },
    {
      "value": "f7f6c687-ec73-4771-bcc6-c1e09cdd1754",
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Structurally valid UUID v7s
GET /api/uuids?type=uuid7&count=5&seed=7
{
  "data": [
    {
      "value": "adda902d-c078-782f-8330-6bfb6818bfc8",
      "type": "uuid7"
    },
    {
      "value": "949856c9-05e7-7256-8ba5-b78fa790d6d8",
      "type": "uuid7"
    },
    {
      "value": "74c3a3bf-0f1c-71d4-81e7-36ba5ca862e9",
      "type": "uuid7"
    },
    {
      "value": "c94e8720-4063-7123-bdff-c2d398968a2d",
      "type": "uuid7"
    },
    {
      "value": "e4496e1e-db92-7137-ad7b-b6be880705b9",
      "type": "uuid7"
    }
  ],
  "meta": {
    "endpoint": "uuids",
    "count": 5,
    "seed": 7,
    "params": {
      "type": "uuid7",
      "uppercase": false
    },
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Five ULIDs
GET /api/uuids?type=ulid&count=5
{
  "data": [
    {
      "value": "3T9YPP1HT3KAG12DRYPCMBSHAW",
      "type": "ulid"
    },
    {
      "value": "0A3W0QQJT2EGZ59GMQWSSPNCYT",
      "type": "ulid"
    },
    {
      "value": "6VCCF7E4QNBEJ0J14S0BNSG6HY",
      "type": "ulid"
    },
    {
      "value": "17GEATZB1715YVNA4X2XY4ZYPE",
      "type": "ulid"
    },
    {
      "value": "6NDPVH274QD81PXWV9THQ2VNBH",
      "type": "ulid"
    }
  ],
  "meta": {
    "endpoint": "uuids",
    "count": 5,
    "seed": 42,
    "params": {
      "type": "ulid",
      "uppercase": false
    },
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Short nanoids for URL slugs
GET /api/uuids?type=nanoid&length=10&count=5
{
  "data": [
    {
      "value": "ermUhCEa00",
      "type": "nanoid"
    },
    {
      "value": "CAch-LSh01",
      "type": "nanoid"
    },
    {
      "value": "2HWdkAlC02",
      "type": "nanoid"
    },
    {
      "value": "JlCL92rU03",
      "type": "nanoid"
    },
    {
      "value": "1tbQDs7504",
      "type": "nanoid"
    }
  ],
  "meta": {
    "endpoint": "uuids",
    "count": 5,
    "seed": 42,
    "params": {
      "type": "nanoid",
      "length": 10,
      "uppercase": false
    },
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Uppercase 32-char hex tokens
GET /api/uuids?type=hex&length=32&uppercase=true&count=3
{
  "data": [
    {
      "value": "7A958016CFB6A5C85EAC58CDD40FB100",
      "type": "hex"
    },
    {
      "value": "0078F248ABECCBA6FD45DF91C3667301",
      "type": "hex"
    },
    {
      "value": "D15790902C05AC838FECF0B9C4166F02",
      "type": "hex"
    }
  ],
  "meta": {
    "endpoint": "uuids",
    "count": 3,
    "seed": 42,
    "params": {
      "type": "hex",
      "length": 32,
      "uppercase": true
    },
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}

GET /api/uuids/inspect

Accepts canonical 8-4-4-4-12 hexadecimal UUID text (case-insensitive). Braced, URN-prefixed and malformed values return 400 rather than being guessed.

Live requestRuns against the public API
No key required
GET/api/uuids/inspect?value=017f22e2-79b0-7cc3-98c4-dc0c0c07398f

Request parameters

Canonical UUID text with five hyphen-separated hexadecimal groups; uppercase input is accepted.

Advanced response options4 options

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/uuids/inspect?value=017f22e2-79b0-7cc3-98c4-dc0c0c07398f"
const res = await fetch("https://randomapi.dev/api/uuids/inspect?value=017f22e2-79b0-7cc3-98c4-dc0c0c07398f");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/uuids/inspect?value=017f22e2-79b0-7cc3-98c4-dc0c0c07398f").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/uuids/inspect?value=017f22e2-79b0-7cc3-98c4-dc0c0c07398f"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 1
value string required

Canonical UUID text with five hyphen-separated hexadecimal groups; uppercase input is accepted.

allowed: 36 – 36
example: value=017f22e2-79b0-7cc3-98c4-dc0c0c07398f
Universal parameters Shared response and formatting options 4
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=input,canonical
exclude list

Return all fields except these (comma-separated).

example: exclude=timestamp
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 10
input string

UUID text exactly as supplied.

example: 017f22e2-79b0-7cc3-98c4-dc0c0c07398f

canonical string

Canonical lowercase UUID text.

example: 017f22e2-79b0-7cc3-98c4-dc0c0c07398f

isNil boolean

Whether all 128 bits are zero (the Nil UUID).

example: false

isMax boolean

Whether all 128 bits are one (the Max UUID).

example: false

variant string

ncs, rfc9562, microsoft or reserved based on the variant bits.

example: rfc9562

isRfc9562 boolean

Whether the variant bits are the RFC 9562 10xx layout.

example: true

version integer nullable

RFC variant version nibble, or null when version semantics do not apply.

example: 7

versionName string nullable

RFC version family name or reservation status, or null for other variants.

example: Unix time-based

unixMilliseconds string (decimal integer) nullable

UUIDv7's unsigned 48-bit Unix millisecond field, or null for other versions.

example: 1645557742000

timestamp string (ISO 8601) nullable

UUIDv7 timestamp rendered as UTC ISO 8601, or null for other versions.

example: 2022-02-22T19:22:22.000Z

Documented examples

Build-generated requests and complete responses
3
Inspect the RFC UUIDv7 example
GET /api/uuids/inspect?value=017f22e2-79b0-7cc3-98c4-dc0c0c07398f
{
  "data": {
    "input": "017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
    "canonical": "017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
    "isNil": false,
    "isMax": false,
    "variant": "rfc9562",
    "isRfc9562": true,
    "version": 7,
    "versionName": "Unix time-based",
    "unixMilliseconds": "1645557742000",
    "timestamp": "2022-02-22T19:22:22.000Z"
  },
  "meta": {
    "endpoint": "uuids",
    "route": "/inspect",
    "params": {
      "value": "017f22e2-79b0-7cc3-98c4-dc0c0c07398f"
    },
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Inspect a common UUIDv4
GET /api/uuids/inspect?value=550e8400-e29b-41d4-a716-446655440000
{
  "data": {
    "input": "550e8400-e29b-41d4-a716-446655440000",
    "canonical": "550e8400-e29b-41d4-a716-446655440000",
    "isNil": false,
    "isMax": false,
    "variant": "rfc9562",
    "isRfc9562": true,
    "version": 4,
    "versionName": "random",
    "unixMilliseconds": null,
    "timestamp": null
  },
  "meta": {
    "endpoint": "uuids",
    "route": "/inspect",
    "params": {
      "value": "550e8400-e29b-41d4-a716-446655440000"
    },
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Identify the special Nil UUID
GET /api/uuids/inspect?value=00000000-0000-0000-0000-000000000000
{
  "data": {
    "input": "00000000-0000-0000-0000-000000000000",
    "canonical": "00000000-0000-0000-0000-000000000000",
    "isNil": true,
    "isMax": false,
    "variant": "ncs",
    "isRfc9562": false,
    "version": null,
    "versionName": null,
    "unixMilliseconds": null,
    "timestamp": null
  },
  "meta": {
    "endpoint": "uuids",
    "route": "/inspect",
    "params": {
      "value": "00000000-0000-0000-0000-000000000000"
    },
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}

About this API

Coverage & behavior

Generates identifiers in the five formats test suites actually need, all from the platform's seeded PRNG — pin a seed and the exact same IDs come back forever, which crypto.randomUUID() can never give you.

  • uuid4 — random RFC 9562 UUID: version nibble 4, variant bits 10xx, lowercase.
  • uuid7structurally valid UUID v7 (version nibble 7, correct variant), but its 48-bit timestamp field is derived from the seed, not the wall clock. Values parse as v7 anywhere, yet stay reproducible per seed — so they are not time-ordered and do not encode the real generation time.
  • ulid — 26 characters of Crockford base32 (the alphabet omits I, L, O, U), always uppercase, first character 0–7 (the canonical ULID range). The 48-bit timestamp half is seed-derived too — same caveat as uuid7.
  • nanoid — URL-safe alphabet A–Z a–z 0–9 _ -; length is configurable (default 21).
  • hex — lowercase hex string; length is configurable (default 64 — handy as a fake SHA-256 digest).

length only applies to nanoid and hex. Their final fixed-width characters encode the zero-based record index, guaranteeing distinct values throughout a maximum-size response while the remaining prefix stays seeded-random. The other formats are fixed-width: supplying length for them adds a notice to meta.warnings instead of silently doing nothing. uppercase=true uppercases the output of any format (ULIDs are already uppercase).

The /inspect route is standards-based rather than generated: it accepts one canonical UUID, reports its RFC 9562 variant and version, recognizes the special Nil and Max UUIDs and exposes the 48-bit Unix millisecond field for UUIDv7. Inspecting a generated UUIDv7 does not change its meaning: this endpoint's generated timestamp bits remain seed-derived fixture data, not a real creation time.

Use it for

  • Stable primary keys for database fixtures that survive re-seeding (same seed ⇒ same IDs)
  • Exercise ID parsing and validation logic against UUID v4/v7, ULID and nanoid formats
  • Fake API keys, trace IDs and content hashes for deterministic integration tests
  • Validate UUID text and inspect its RFC variant, version and UUIDv7 timestamp

Frequently asked questions

Which ID types are supported?

type=uuid4|uuid7|ulid|nanoid|hex — five families: random v4, v7 and ULID (with seed-derived timestamp fields), compact NanoID and raw hex.

Are UUID v7 values time-ordered?

No — deliberately not. The timestamp field is derived from the seed instead of the clock so output is reproducible; values parse as valid v7 but don't encode real creation time. If you need true time-ordering, generate v7 ids locally.

Are these IDs suitable for production?

They're spec-shaped, but generate production ids locally — an HTTP round-trip per id is the wrong architecture. Use this for fixtures, docs and quick scripts.

Can I get uppercase or custom-length ids?

uppercase=true capitalizes hex-based types, and length adjusts the variable-length types (nanoid, hex).

Can the API validate and inspect an existing UUID?

Yes. /inspect accepts canonical UUID text, normalizes case and reports the RFC variant, version, Nil/Max status and UUIDv7 timestamp fields. That inspection is standards-based even though the endpoint's generated IDs are mock fixtures.

Standards & references