Frequently Asked Questions
What is a MongoDB ObjectId?
A MongoDB ObjectId is a 12-byte unique identifier automatically generated for each document. The 12 bytes consist of:
- 4-byte timestamp: Creation time in seconds since Unix epoch
- 5-byte random value: Unique to the machine and process
- 3-byte counter: Incremental per process
How do I extract a timestamp from an ObjectId?
Use this converter to instantly extract the embedded timestamp. In MongoDB shell, use ObjectId.getTimestamp() method which returns the timestamp as a Date object.
Can I generate an ObjectId from a specific timestamp?
Yes! This converter lets you enter any date to generate a valid ObjectId. In MongoDB shell: ObjectId(Math.floor(new Date("2024-01-01")/1000))
Is this converter free and private?
Yes, completely free with no registration required. All conversions happen in your browser—no data is sent to servers, so your information stays private and secure.