Back to the blog

Developer

IDs that know when they were made.

Make ULIDs that sort by time, and read a ULID, KSUID, ObjectId or Discord or X Snowflake ID back to the moment it was made.

By Updated 4 min read

A developer toolkit reading encoded text in two steps, URL decode then Base64 decode, to give Hello, world!

Many IDs carry the time they were made in their first bits, so they sort by it. A ULID, a KSUID, a MongoDB ObjectId and the Snowflake IDs of X and Discord all do, each in its own way.

Make ULIDs.

Open the ULID generator and make one or many: 26 characters of Crockford's Base32, the first ten of them the time in milliseconds. ULIDs made in the same millisecond count up by one, as the spec's monotonic ULIDs do, so they still sort. KSUIDs, NanoIDs (with any alphabet and length, and how many can be made before two are likely to be the same) and ObjectIds are a press away.

Read the time back.

Paste a ULID, KSUID, ObjectId or Snowflake ID and the time it was made is shown in UTC and your own time, with what else it holds: an ObjectId's counter, a Discord ID's worker and increment. A Snowflake is read by the epoch of the platform that made it, X's or Discord's, or one you give.

Nothing leaves your browser.

Everything is worked out on your device: what you paste or open is never sent anywhere, and nothing is kept when you leave. A share link carries what you typed after the #, which browsers never send to a server.

Further reading

Topics: ulid generator · ulid vs uuid · uuid v7 vs ulid · ulid decoder · nanoid · ksuid · snowflake id · objectid timestamp

A little less theory. A little more doing.

Try it on your own terms, with a free browser tool.

Try the tool