Inside a MongoDB ObjectID
An ObjectID is 12 bytes: a 4-byte Unix timestamp, a 5-byte random value fixed per process, and a 3-byte incrementing counter. That layout means ObjectIDs sort roughly by creation time and can be generated on any client without coordination - and it also means anyone holding an ID can read the creation time straight out of it. The full byte layout and its consequences are unpacked in MongoDB ObjectID explained.
Generate valid ObjectIDs here for seeding test data or building API fixtures. If you are choosing an ID format for a system that is not MongoDB, compare UUID and ULID first - both are 16 bytes and standardised.