BSON to JSON Converter Online

Convert BSON Extended JSON to regular JSON online instantly. Free tool for MongoDB developers to strip BSON type wrappers and produce clean JSON. Runs in your browser, no signup needed.

Loading editor...
Loading editor...

What is BSON to JSON Conversion?

BSON to JSON conversion transforms BSON Extended JSON (EJSON)—MongoDB's type-annotated format—back into standard JSON. EJSON wraps MongoDB-specific types in special objects like $oid for ObjectIDs and $date for dates. A BSON to JSON converter strips these wrappers and produces clean, portable JSON that any language or tool can consume without needing a MongoDB BSON library.

Why Convert BSON to JSON?

Use a BSON to JSON converter when you have MongoDB document exports or driver output in Extended JSON format and need to work with the data in tools that expect standard JSON. REST APIs, data analysis tools, and most JavaScript frameworks do not understand EJSON type wrappers. Converting BSON to JSON removes those wrappers so you can feed the data into any downstream system.

How Our BSON to JSON Converter Works

Paste your BSON input and click Convert. Use the input format toggle to select between Extended JSON (EJSON) — the human-readable format with type wrappers — or Hex Binary, which is the raw BSON wire format as a hex string. The tool auto-detects the format if you do not switch the toggle manually. EJSON type wrappers are stripped and the result is clean standard JSON. ObjectIDs become strings, dates become ISO strings, and binary data is base64-encoded.

Features You Get

  • Accepts both Extended JSON (EJSON) and raw BSON hex binary as input.
  • Auto-detects input format — no manual switching needed in most cases.
  • Handles all BSON types: ObjectID, Date, Binary, NumberLong, Decimal128, and more.
  • Outputs clean, human-readable JSON with consistent indentation.
  • Upload support: load a .json file from your device or drag-and-drop.
  • One-click copy: grab the JSON output with the Copy button.

How to Use the Tool

  1. Paste your BSON Extended JSON or Hex Binary into the input editor, or upload a file.
  2. Use the Extended JSON / Hex Binary toggle if you want to switch input syntax highlighting.
  3. Click Convert to generate the regular JSON output.
  4. Click Copy to copy the output to your clipboard.
  5. Use Clear to reset both editors.

Common Use Cases

  • MongoDB export processing: converting mongoexport EJSON output to plain JSON for downstream tools.
  • API responses: stripping BSON type wrappers from MongoDB driver responses before sending to clients.
  • Data analysis: preparing MongoDB document data for analysis tools that expect standard JSON.
  • Debugging: reading MongoDB documents without needing to understand EJSON syntax.

Example Conversion

Input (BSON)

{
  "_id": {"$oid": "507f1f77bcf86cd799439011"},
  "name": "Alice"
}

Output (JSON)

{
  "_id": "507f1f77bcf86cd799439011",
  "name": "Alice"
}

Frequently Asked Questions

Related Converters