Paste a document as JSON, Extended JSON, or straight from the mongo shell — ObjectId() and ISODate() included — to measure its BSON size in bytes, see which fields use the most space, and check how much of MongoDB's 16 MB document limit it uses. Your document is parsed locally and never uploaded.
MongoDB stores documents as BSON (Binary JSON), a binary encoding of your JSON-like data. BSON is not the same size as the JSON text: each field carries a type byte and a length prefix, and values are stored in fixed binary widths. This tool measures that encoded size by serialising your document with MongoDB's official bson library — the same code path a driver uses to put a document on the wire.
All three of the formats you're likely to have on your clipboard:
{"userId": "USR-0001", "active": true}mongoexport or shown in Compass — {"_id": {"$oid": "6a7b27c71d2aab315fbc84f2"}}{_id: ObjectId("6a7b27c71d2aab315fbc84f2"), createdAt: ISODate("2025-03-23T09:00:00Z")}Shell types are all supported: ObjectId(), ISODate(), NumberInt(), NumberLong(), NumberDecimal(), Timestamp(), BinData(), UUID(), DBRef(), Code(), MinKey, MaxKey and regular expression literals such as /^ab/i. So are the conveniences the shell allows: unquoted field names, single-quoted strings, trailing commas and comments.
A bare number such as 42 is the one genuinely ambiguous value in a pasted document. The drivers store an integer that fits in 32 bits as a 4-byte int32. mongosh does not: a number literal there is a JavaScript double, so the same field is stored as an 8-byte double. Four bytes per field sounds trivial until you paste a document with hundreds of numbers in it.
Use the toggle under the input to say which one you want. If you copied the document out of mongosh, pick double. If you're modelling what your application will write, pick int32. Values with an explicit type — NumberLong("42"), {"$numberInt": "42"} — are exact and ignore the setting entirely.
A single BSON document cannot exceed 16 MB. Hit that ceiling and writes fail, so it's worth watching for documents with large arrays or embedded blobs. If you're approaching the limit, reference large sub-documents in a separate collection or store binary payloads in GridFS.
"0", "1", "2" and so on — which is why long arrays cost more than they look, and why the index names start to matter past a thousand entries.The breakdown lists every field with its full cost — type byte, field name and value — sorted largest first, so the field responsible for an oversized document is at the top. Nested documents and arrays expand, and the numbers add up exactly: the rows at any level sum to their parent. A document that's too large is nearly always one unbounded array or one embedded blob, and this is the fastest way to find out which.
VisuaLeaf
VisuaLeaf's visual schema designer helps you spot unbounded arrays and oversized embeds before they become a problem, alongside a full MongoDB and SQL client with query builders and charts.