MongoDB ObjectId Decoder
Paste a MongoDB ObjectId to decode its embedded creation timestamp, random value, and counter. Runs entirely in your browser.
🔒 This tool runs entirely in your browser. Your files are never uploaded to a server.
Decoded
Timestamp: 2012-10-17 20:46:22 UTC
Random value: 0x0c19729de8
Counter: 0x60ea
Example shown — replace it with your own ObjectId.
How it works
- Paste a 24-character MongoDB ObjectId.
- The hex string is split into its timestamp, random value, and counter segments.
- See the decoded creation time and other fields instantly.
Decoding reads the first 4 bytes of the 12-byte ObjectId as a Unix timestamp, converts it to a readable date, and displays the remaining random-value and counter bytes — the same structure MongoDB's driver uses internally to generate each ObjectId.
FAQ
Is my ObjectId uploaded anywhere?
No. Decoding happens entirely in your browser — nothing is sent to a server.
What information is embedded in an ObjectId?
A 4-byte creation timestamp, a 5-byte random value unique to the machine and process, and a 3-byte incrementing counter — 12 bytes total, shown as 24 hex characters.
Can I get the exact creation time of a document from its ObjectId?
Yes — the first 4 bytes encode a Unix timestamp, giving you the document's creation time to the second, without querying the database.
Does it validate whether the input is a real ObjectId?
Yes — invalid input (wrong length or non-hex characters) is flagged instead of producing a misleading result.
How we compare
| Feature | Online Tool Store | MongoDB shell / driver | MongoDB Compass |
|---|---|---|---|
| No database connection needed | ✓ | Requires a connected MongoDB instance | Requires a connected MongoDB instance |
| Free, no install | ✓ | ✓ | Desktop install required |
MongoDB's own shell needs a live database connection to decode an ObjectId. MongoDB ObjectId Decoder works on a copied ID alone, no connection required.