CUID to Timestamp Converter

Extract the embedded timestamp from any CUID v1 identifier. See exactly when the ID was generated with millisecond precision.

⚠️

CUID v1 Only

This converter only works with CUID v1 (25 characters, starts with "c"). CUID2 does not contain an extractable timestamp by design.

How CUID Timestamp Extraction Works

A CUID v1 has a specific structure that includes an embedded timestamp. Here's how the components break down:

Example CUID:
cl9ebqkxk0000mc04r8fzagsy
c
Prefix
l9ebqkxk
Timestamp
0000
Counter
mc04
Fingerprint
r8fzagsy
Random

Decoding Process

  1. Extract characters 2-9 (the timestamp portion)
  2. Convert from base36 to decimal (the Unix timestamp in milliseconds)
  3. Convert milliseconds to a human-readable date/time

Understanding the Components

  • Prefix (c): Identifies the string as a CUID
  • Timestamp: 8 base36 characters = milliseconds since epoch
  • Counter: Prevents collisions within the same millisecond
  • Fingerprint: Identifies the machine/process that generated the ID
  • Random: Additional randomness for uniqueness

Frequently Asked Questions

How does CUID store the timestamp?

CUID v1 stores the timestamp as the second through ninth characters (8 characters total), encoded in base36 format. This represents the number of milliseconds since the Unix epoch (January 1, 1970).

Why can't I retrieve a timestamp from CUID2?

Designed for security, CUID2 doesn't include a timestamp. It uses cryptographically secure random generation to prevent anyone from determining when an ID was created. This is a deliberate security feature.

How accurate is the extracted timestamp?

The timestamp is accurate to the millisecond when the CUID was generated. Note that the timestamp reflects the local system time of the machine that generated the CUID.

What are the other components of a CUID?

Besides the timestamp, CUID contains a "c" prefix, a counter (prevents same-millisecond collisions), a fingerprint (identifies the machine/process), and random characters (adds uniqueness).

Is it possible to create a CUID with a specific timestamp?

Not with standard CUID libraries - they always use the current time. Crafting a CUID manually with a specific timestamp would bypass the other uniqueness guarantees (counter and fingerprint) and isn't recommended.