ObjectId Generator
Generate ObjectIds and decode their timestamps
What is ObjectId Generator?
A MongoDB ObjectId is a 24-character hexadecimal identifier made up of a 4-byte timestamp followed by 8 bytes of random data. This tool generates ObjectIds in bulk and also works in reverse, extracting the creation time from any ObjectId you paste in. Both directions run locally in your browser.
How to use ObjectId Generator
- 1Set how many ObjectIds to generate, then generate them.
- 2Paste an existing ObjectId on the right to decode its creation time.
- 3Copy the results for test fixtures or query filters.
Frequently asked questions
Can you get the creation time out of a MongoDB ObjectId?+
Yes. The first 4 bytes are a Unix timestamp in seconds, so you can tell roughly when a document was created without a separate createdAt field, and you can even filter by time range by comparing ObjectIds. The trade-off is that the ID leaks its creation time, which is worth weighing before exposing it publicly.
Is it safe to generate ObjectIds on the client?+
ObjectIds are designed to be generated client-side — the official drivers do exactly that, which is how you can know a document's ID before inserting it. Just remember that only about 64 bits are random, so an ObjectId is not suitable as an unguessable credential.
Related tools
All toolsUUID Generator
Generate UUID v4 or v7 in bulk, with optional hyphen removal
ULID Generator
Generate ULIDs and decode the timestamp embedded in each one
NanoID Generator
Generate NanoIDs at an adjustable length
Password Generator
Generate strong random passwords with a configurable character set
Random String Generator
Generate random strings in bulk from a character set of your choice
Lorem Ipsum Generator
Generate Latin or Chinese placeholder text by paragraph or sentence