Online Tool Store Online Tool Store

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

  1. Paste a 24-character MongoDB ObjectId.
  2. The hex string is split into its timestamp, random value, and counter segments.
  3. 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 neededRequires a connected MongoDB instanceRequires a connected MongoDB instance
Free, no installDesktop 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.

Explore related tools

Embed this tool

Paste this on your own site — it stays free, and every file still stays in your visitor's browser, not yours or ours.