MongoDB ObjectID generator
Generate MongoDB ObjectIDs (24 hexadecimal characters) with an embedded timestamp.
🔒 100% client-side — no data sent
Generate valid 24-character hexadecimal MongoDB ObjectIDs for your tests, seeds or manual inserts. Generation uses crypto.getRandomValues, 100% in the browser: nothing is sent to a server.
What is it for?
- ▸ Create _id values for MongoDB test documents.
- ▸ Seed a database with realistic data.
- ▸ Simulate references between collections.
- ▸ Test an API expecting a valid ObjectID.
FAQ
What is a MongoDB ObjectID made of?
Of 12 bytes: 4 for a timestamp, 5 of process-specific randomness and 3 of a counter, i.e. 24 hex characters.
Does the ObjectID contain a date?
Yes, its first 4 bytes encode the creation timestamp, which can be extracted from the ID.
Is an ObjectID sortable by date?
Approximately: sorting by _id roughly matches creation order to the second.
Are these generated ObjectIDs valid for MongoDB?
Yes, they follow the 24-character hexadecimal format and are accepted as _id.