MongoDB ObjectId Decoder: quick start guide

Everything you need for a first successful run: what to paste in, which option actually matters, and how to read the result.

Input MongoDB ObjectId Decoder Output Runs 100% in your browser — your data never leaves your device.
MongoDB ObjectId Decoder — Input → Output. Runs 100% in your browser — your data never leaves your device.

How to use

  1. Open the tool and paste your input into the left pane.
  2. Set only the options your task actually needs — the defaults are correct for most inputs.
  3. Read the result in the right pane; it updates as you type.
  4. Use Copy to take the result, or Download to save it as a file.
How to use · MongoDB ObjectId Decoder 1 Paste your data intothe input box (or loadthe example). 2 Configure the optionsto match your targetformat or scenario. 3 Copy, download orinspect the output —it updates live as youtype.
How to use — 3

Examples

The first four bytes are a Unix timestamp, which is why ObjectIds sort roughly by creation time.

Input

507f1f77bcf86cd799439011

Output — Results

507f1f77bcf86cd799439011

Layout (12 bytes / 24 hex characters)
  timestamp    4 bytes  507f1f77  = 1350508407
  random       5 bytes  bcf86cd799   (process-unique, per the current spec)
  counter      3 bytes  439011   = 4427793

Creation time (UTC)   2012-10-17T21:13:27.000Z
Creation time (local) Wed Oct 17 2012 21:13:27 GMT+0000 (Coordinated Universal Time)
Age                   5091.9 days

Older drivers used 3-byte machine id + 2-byte process id instead of 5 random bytes;
both layouts put the timestamp first, which is why ObjectIds sort roughly by time.

Run

Description

Extract the creation timestamp, random bytes and counter from a 24-character ObjectId.

MongoDB ObjectId Decoder → · How to use → · Developer Tools →

Related tools