🔍

首页Home › 开发工具Developer Tools

🧱 JSON 转 BSON(十六进制)Convert JSON to BSON

把 JSON 编码为 BSON 二进制并以十六进制(或 Base64)显示,支持常见类型(对象、数组、字符串、数字、布尔、null)。本地处理。Encode JSON as BSON and show it as hex (or Base64). Supports common types (object, array, string, number, boolean, null). Processed locally.

使用说明与常见问题How-to & FAQ

「JSON 转 BSON(十六进制)」是什么?What is the Convert JSON to BSON tool?

把 JSON 编码为 BSON 二进制并以十六进制(或 Base64)显示,支持常见类型(对象、数组、字符串、数字、布尔、null)。本地处理。Encode JSON as BSON and show it as hex (or Base64). Supports common types (object, array, string, number, boolean, null). Processed locally.

如何使用「JSON 转 BSON(十六进制)」?How do I use the Convert JSON to BSON tool?

在「JSON 转 BSON(十六进制)」中,把内容粘贴或输入到上方输入框,结果会实时显示在下方,点击「复制结果」即可复制。In the Convert JSON to BSON: Paste or type into the input box; the result appears below instantly — click "Copy result" to copy it.

完整 BSON 吗?Is this full BSON?

覆盖常用类型;ObjectId、Date、Binary 等扩展类型未实现。Common types are covered; ObjectId, Date, Binary and other extensions are not.

整数怎样编码?How are integers encoded?

按原文精确处理:int32 范围内用 int32(类型 0x10),更大的用 int64(0x12),例如 9007199254740993 精确存成 int64;超出 int64 的整数会报错并说明,不会悄悄变成 double。带小数点或指数的数用 double(0x01)。Exactly as written: values in the int32 range use int32 (type 0x10), larger ones int64 (0x12), so 9007199254740993 is stored exactly as int64; integers beyond int64 give a clear error instead of silently becoming a double. Numbers with a decimal point or exponent use double (0x01).

大数字和重复键会怎样?What about big numbers and duplicate keys?

数字按原文保留,不经过 JavaScript 浮点:12345678901234567890、1e400、1.50 原样输出,不会变成 12345678901234567000、Infinity 或 1.5。重复的键按 JSON 规则保留最后一个值,并在结果下方提示是哪个键。语法错误会写出第几行第几列。Numbers are kept exactly as written, with no JavaScript floating-point step: 12345678901234567890, 1e400 and 1.50 come out unchanged instead of 12345678901234567000, Infinity or 1.5. Duplicate keys keep the last value, as JSON parsers do, and a notice below the result names the key. Syntax errors give the line and column.

输入和输出是什么样的?What does the input and output look like?

例如在「JSON 转 BSON(十六进制)」中输入 {"a":1},「十六进制加空格」设为 勾选,输出为:0c 00 00 00 10 61 00 01 00 00 00 00。For example, the Convert JSON to BSON turns the input {"a":1}, "Space hex bytes" set to on into: 0c 00 00 00 10 61 00 01 00 00 00 00.

有哪些选项可以调整?What options can I adjust?

「JSON 转 BSON(十六进制)」的设置:可勾选:「十六进制加空格」(默认勾选)、「输出 Base64」。每次生成结果都按当前设置处理。Settings in the Convert JSON to BSON — tick boxes: "Space hex bytes" (on by default), "Output Base64". The result always uses the current settings.

代码或数据会被上传吗?Is my code or data uploaded?

不会。「JSON 转 BSON(十六进制)」完全用 JavaScript 在本地运行,适合处理含有密钥、内部接口等敏感内容的数据。No. The Convert JSON to BSON runs entirely in local JavaScript, so it is safe for data containing keys or internal endpoints.

「JSON 转 BSON(十六进制)」免费吗?需要注册吗?Is the Convert JSON to BSON free? Do I need an account?

「JSON 转 BSON(十六进制)」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Convert JSON to BSON is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.

相关工具Related tools

⚙ JSON 转 Java PropertiesConvert JSON to Properties🧾 JSON 格式化校验JSON Formatter & Validator📊 TSV 分析Analyze TSV📄 文本转 TSVConvert Text to TSV📤 提取 TSV 列Extract TSV Columns🔍 查找不完整 TSV 行Find Incomplete TSV Values✂️ TSV 去除单元格首尾空格Trim TSV Columns🔓 TSV URL 解码URL-Decode TSV🔗 TSV URL 编码URL-Encode TSV✅ 校验 TSVValidate TSV📡 波特率计算器Baud Rate Calculator🧾 TOML 生成器TOML Generator

← 全部工具All tools