DevToolCase
Sign in Sign in

Generate UUID v7s

Generate time-ordered UUID v7s, ideal as database keys, and read the creation date of a UUID v7.

UUID v7: the creation time in milliseconds, then random bits; they sort in creation order, which suits database keys.

Read an identifier

Runs entirely in your browser: nothing you type is sent or stored.

What is a UUID v7?

Standardised in 2024 (RFC 9562), the UUID v7 starts with the Unix time in milliseconds, on 48 bits, followed by random bits. It keeps the UUID format, so it fits any uuid column, but its values sort in creation order.

Why it suits database keys

  • New rows go to the end of the index instead of anywhere in it: fewer page splits, faster inserts in PostgreSQL or MySQL.
  • Sorting by identifier is sorting by creation date.
  • The creation date can be read back: paste a UUID v7 under “Read an identifier”.

The catch

Anyone who sees the identifier can read when it was created. When that matters, prefer a random UUID v4.

Add this browser’s favorites to your account?

This browser has 0 favorites that your account does not have:

Either way, this browser keeps its favorites: you find them again after signing out.