MongoDB Extended JSON and ObjectId Viewer

Drop in a mongoexport file or paste mongosh output to see every document as a typed table, decode ObjectId creation times and convert between canonical, relaxed and shell syntax.

Runs in your browser. Your files never leave your device. See how to check

…

How to do it

  1. 1
    Open the data

    Drop a .json or .ndjson export, paste mongosh output, or load a sample.

  2. 2
    Check the overview

    Look at the document count, read errors and mixed-type columns.

  3. 3
    Browse the table

    Read the typed columns and tap a row to open the full document.

  4. 4
    Filter

    Type a MongoDB condition or plain words to narrow the documents.

  5. 5
    Decode ids

    Open the ObjectId tab to read creation times or build an _id for a date.

  6. 6
    Convert or export

    Download canonical, relaxed or shell output, or a CSV with chosen fields.

About this tool

Plain JSON has no dates, no 64-bit integers and no decimals, so MongoDB writes BSON values in Extended JSON: an ObjectId becomes {"$oid": "..."}, a date becomes {"$date": ...} and a long becomes {"$numberLong": "..."}. Files exported with mongoexport, logs and API dumps are full of these wrappers and hard to read. This viewer opens them. It accepts a JSON array, one document per line as mongoexport writes by default, a single document, canonical Extended JSON, relaxed Extended JSON and the shell syntax printed by mongosh, with ObjectId('...'), ISODate('...'), Long, NumberInt, Decimal128, UUID, BinData, Timestamp, MinKey and regular expressions. Every value is read into its BSON type, so the table can show and colour types: ObjectIds, dates, Int32, Int64, Double, Decimal128, strings, booleans, nulls, binary data and UUIDs. Nested objects become dot-path columns such as customer.name, and each column header lists the types found in it. A document that cannot be read is reported with the line where it starts, and the rest still load. The overview counts documents and fields, names columns with mixed types and uses the ObjectId timestamps to tell you when the first and last documents were created.

Converting between Extended JSON modes

Canonical mode keeps every type exactly: Int32 is written as {"$numberInt": "42"} and dates as milliseconds in {"$numberLong"}, which is what mongoimport needs for a faithful restore. Relaxed mode is the readable form: ordinary numbers stay as JSON numbers, dates between 1970 and 9999 are ISO strings, and Int64 values larger than 2 to the power 53 stay wrapped so they are not rounded. The shell mode prints mongosh syntax you can paste into a query, and plain JSON strips the types for tools that only understand JSON, with a warning about what is lost. Output can be a JSON array, one document per line or pretty printed.

Filter, ObjectId and CSV

The filter box takes a MongoDB condition in JSON or shell syntax, for example {status: "paid", total: {$gte: 100}}, with $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $exists, $type, $regex, $size, $and, $or, $nor and dot paths into arrays. Numbers of different types are compared by value, as the server does. Plain words do a text search instead. The ObjectId tab splits an id into its 4-byte timestamp, 5-byte random value and 3-byte counter, and builds the smallest ObjectId for any date so you can query _id ranges by time. The CSV tab writes the fields you choose, or all table columns, the way mongoexport --type=csv does.

Worked example

The canonical sample holds 4 order documents, one per line, with 9 columns. total is listed as a mixed column because three orders use Decimal128 and one uses Double. The first _id, 6720b8c1f1a2b3c4d5e6f701, decodes to 1730197697 seconds, which is 29 October 2024 at 10:28:17 UTC, with random value f1a2b3c4d5 and counter 15136513. In relaxed mode, orderNo 9007199254740993 stays as {"$numberLong"} because it is larger than JavaScript can store exactly, while qty becomes the number 1. The filter {status: "paid"} keeps documents 1 and 4, and {createdAt: {$gte: ISODate("2024-10-30T00:00:00Z")}} keeps documents 3 and 4. The smallest ObjectId for 30 October 2024 at midnight UTC is 672177000000000000000000.

Limits

This is a viewer and converter, not a database: it does not connect to MongoDB, run aggregation pipelines or support every query operator, and $where or $expr are refused. Very large exports are limited by browser memory; files over 30 MB are not opened. To run queries and aggregation stages on sample data, use the MongoDB Query Playground on this site.

Worked example

Orders sample: 4 documents, total mixed Decimal128 and Double; _id 6720b8c1... decodes to 2024-10-29 10:28:17 UTC; {status: "paid"} keeps 2 documents.

Quick facts

Frequently asked questions

What is the difference between canonical and relaxed Extended JSON?

Canonical keeps every BSON type, so an Int32 and a Double stay different. Relaxed writes ordinary numbers and ISO dates, which are easier to read but lose the difference between number types.

How do I read the date inside an ObjectId?

The first 8 hexadecimal characters are the creation time in seconds since 1970. Paste the id into the ObjectId tab and it shows the UTC and local time, the random part and the counter.

Why does my export show $numberLong?

The value is a 64-bit integer. Large ones cannot be stored exactly as JSON numbers in JavaScript, so Extended JSON keeps them as strings inside $numberLong. Relaxed mode unwraps only the safe ones.

Can I open the output of mongosh directly?

Yes. Shell syntax such as ObjectId('...'), ISODate('...'), Long('...') and unquoted keys is converted to Extended JSON before reading, so you can paste results straight from a terminal.

How is this different from the MongoDB Query Playground?

The playground runs find and aggregate commands on sample documents. This viewer focuses on files: reading every Extended JSON type exactly, converting modes, decoding ObjectIds and exporting CSV.

Are my documents uploaded?

No. Files are read by this page in your browser. Your last input is saved in local storage on this device only.

Guides for this tool

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages