JSON to BSON Type Mapper

Analyze how MongoDB stores your JSON as BSON. See the exact BSON type, type code, estimated byte size, and MongoDB shell representation for each field.

Input JSON
Drop JSON file here
BSON Type Analysis

Features

🍃 BSON Type Detection

  • ObjectId detection (24-char hex)
  • ISO date string → BSON Date
  • Int32 vs Int64 inference
  • Double vs string disambiguation

📐 Size Estimation

  • Per-field byte size estimate
  • Total BSON document size
  • BSON overhead calculation
  • Optimization guidance

🔧 MongoDB Shell Output

  • Ready-to-use insertOne() example
  • Correct shell type constructors
  • ObjectId(), ISODate(), NumberLong()
  • Copy-paste ready

BSON Types Guide

What is BSON?

BSON (Binary JSON) is the binary-encoded serialization format MongoDB uses to store documents. It extends JSON with additional types like ObjectId, Date, Int32, Int64, and Binary.

// JSON string → BSON ObjectId
"_id": "507f1f77bcf86cd799439011"
// MongoDB stores as: ObjectId("507f1f77bcf86cd799439011")