Free tool

ObjectId ↔ UUID converter

Convert an ObjectId to a UUID by zero-padding, reverse it exactly, and decode what the 12 bytes actually contain.

UUID
507f1f77-bcf8-6cd7-9943-901100000000
What the ObjectId encodes
Created2012-10-17T21:13:27.000Z4-byte Unix timestamp
Random valuebcf86cd7995 bytes, unique per process
Counter44277933-byte incrementing counter

The conversion zero-pads the 12 ObjectId bytes to 16, so it is reversible and preserves sort order by creation time. Note that the result is not a version-4 UUID — the version and variant bits carry ObjectId data. A NoSQLSync migration does not do this: it stores an ObjectId as its 24-character hex string. Use this when you have decided you want UUID keys and will convert every reference yourself.

Run it against your real database

NoSQLSync samples your collections, infers the schema, and migrates the data with live CDC. Free plan, no credit card.

Start free →