MongoDB ObjectID Generator
Generate valid MongoDB ObjectIDs in bulk and decode any ID back to its creation time.
1 to 100 per batch.
Leave empty to embed the current time.
Paste any ObjectID to see its embedded creation time. Everything runs in your browser. Nothing is uploaded.
How to generate a MongoDB ObjectID online
Set the count
Choose how many ObjectIDs to generate, from 1 to 100 per batch.
Pick a timestamp
Leave the timestamp field empty to embed the current time, or set a custom date for the IDs to carry.
Copy the IDs
Copy a single ID with its row button, or copy the whole batch with one click.
Decode any ID
Paste an existing ObjectID into the decoder to reveal its embedded creation time.
Why use this tool
Bulk generation with a real counter
Create up to 100 ObjectIDs per batch. The 3 byte counter increments across the batch, so every ID is unique and sorts in generation order.
Custom timestamps
Embed any date between 1970 and 2106 in the timestamp bytes, useful for building test data that looks like it was created at a specific moment.
Built-in decoder
Paste any 24 character ObjectID, even wrapped in ObjectId("..."), and see its creation time in UTC and local time plus the random and counter sections.
Uppercase or lowercase
Switch the hex output between lowercase and uppercase with one toggle. Both forms are accepted everywhere ObjectIDs are used.
Runs entirely in your browser
IDs are generated and decoded on your device. Nothing is uploaded, so production IDs stay private.
About this tool
Every document in a MongoDB collection gets a 12 byte ObjectID, rendered as 24 hexadecimal characters. The first 4 bytes store the creation time as seconds since 1970, the next 5 bytes hold a random value, and the last 3 bytes are a counter that increases with each new ID. This tool builds IDs the same way: it stamps the current time (or a time you choose), fills the random section with secure random values, and increments the counter across the batch so every ID in a run is unique and sorts in the order it was generated.
Generate 1 to 100 IDs at a time for seeding test databases, writing fixtures, or mocking API responses. Set a custom timestamp when you need IDs that appear to have been created at a specific moment, which helps when testing time range queries or building realistic sample data. The decoder works in the other direction: paste any ObjectID, including one wrapped in ObjectId("...") copied from a shell, and it shows the embedded creation time in UTC and your local timezone along with the random and counter sections.
Everything runs in your browser, so IDs from production systems never leave your machine when you decode them. For other kinds of test identifiers, try the UUID v5 generator, or fill whole records at once with the mock data generator.
Frequently asked questions
- What is a MongoDB ObjectID?
- It is the default 12 byte identifier MongoDB assigns to every document, shown as 24 hex characters. It packs a 4 byte creation timestamp, 5 random bytes, and a 3 byte counter, so IDs are unique and roughly sortable by creation time.
- Are the generated IDs valid for a real database?
- Yes. They follow the exact 12 byte layout MongoDB uses: a big endian timestamp, a random middle section, and an incrementing counter. You can insert them as the _id field of any document.
- Can I decode an existing ObjectID?
- Yes. Paste any 24 character ObjectID into the decoder, with or without an ObjectId("...") wrapper, and it shows the embedded creation time in UTC and local time, the unix seconds, and the random and counter values.
- Why do all IDs in a batch share the same timestamp?
- The whole batch is generated in the same second, so the 4 timestamp bytes match. The counter section still increments per ID, which keeps every ID in the batch unique.
- Is my data uploaded anywhere?
- No. Generation and decoding both happen in your browser; nothing is sent to a server, so it is safe to decode IDs from production systems.
- How many ObjectIDs can I generate at once?
- Up to 100 per batch. Press Regenerate as often as you like; each batch gets fresh random bytes and a fresh counter start.
Related tools
UUID v5 Generator
Generate deterministic name-based UUIDs from a namespace and a name. Supports version 5 and version 3, single values or whole batches.
Mock Data Generator
Build a schema and generate fake records as JSON, CSV, SQL inserts, or NDJSON. Add a seed to get the same data every time.
API Key Generator
Generate cryptographically random API keys and tokens in hex, base62, or base64url, with control over length, an optional prefix, and bulk output.
ASCII Table Reference
The full ASCII character set with decimal, hex, octal, binary, and HTML codes. Search by code, character, or name.
Atbash Cipher
Mirror the alphabet so A swaps with Z, B with Y, and so on. Atbash is its own inverse, so one field both encodes and decodes as you type.
Base32 Encoder and Decoder
Encode text to standard Base32 and decode Base32 back to text, following RFC 4648.