TypeID Generator
Press c to copy or r for a new one
Leave it empty for a bare 26-character TypeID.
Generate in bulk
What is a TypeID?
A TypeID is a UUID v7 with a label on the front. Write the 128 bits as 26 characters of lowercase Crockford base32, join a type prefix to it with an underscore, and you get something like user_01h4h1p9nhe0fs9k2mtqz9k7bq.
The suffix carries exactly the bits of the UUID underneath, nothing added and nothing dropped, so the conversion runs both ways without loss. A TypeID goes into a UUID column and comes back out as a TypeID.
A prefix is up to 63 lowercase letters and may contain underscores, as long as it starts and ends with a letter. An empty prefix is legal and gives you the bare 26-character suffix.
What the prefix buys you
An identifier on its own tells you nothing. Find 01h4h1p9nhe0fs9k2mtqz9k7bq in a log line and you still have to go and ask which table it belongs to. Write it as user_01h4h1… and the question has already answered itself.
Stripe has done this for years with cus_, ch_ and the rest of its identifiers. TypeID takes the same habit and writes it down as a spec, with a fixed encoding and a defined route back to a plain UUID.
The type also catches a whole family of bugs at the boundary. An order ID passed where a customer ID was expected stops being a silent mismatch and starts being a visible one.
Sorting, and what it gives away
Because a v7 sits underneath, TypeIDs sort by creation time. The base32 encoding is left-padded on purpose so that the text order matches the byte order, which is the same trick a ULID uses.
The flip side comes with every time-ordered ID. That millisecond timestamp is sitting in the string, readable by anyone who has the ID. Paste one into the decoder and you get back the prefix, the UUID and the moment it was made.
Generate one in code
TypeScript
import { typeid } from "typeid-js";
typeid("user").toString();Python
from typeid import TypeID # pip install typeid-python
str(TypeID(prefix="user"))Go
import "go.jetify.com/typeid/v2"
typeid.MustGenerate("user").String()