MongoDB ObjectId Decoder
Paste a MongoDB ObjectId and see the creation timestamp, the random value with its legacy machine and process id split, and the counter, color coded so each part of the ID maps to its meaning. Also generates ObjectIds for any date, handy for time-range queries.
Everything runs locally in your browser. Your data never leaves your device.
Bare hex or the ObjectId("…") form the mongo shell prints, either case.
ObjectId for a date
Every ObjectId created at this second lies between the two values. For a time-range query, use each boundary date's first id, e.g. { _id: { $gte: ObjectId(start), $lt: ObjectId(end) } }.
Pick a date and time to get the matching boundary ids.
Generate an ObjectId
Generating…
A fresh id for the current moment: the timestamp is now, the random value and counter come from the browser's crypto randomness.