🔍

首页Home › 开发工具Developer Tools

平 展平 JSON 对象Flatten JSON Object

把嵌套 JSON 对象展平成单层,键用点号连接(a.b.c);数组下标写成 [0]。本地处理。Flatten a nested JSON object into one level with dotted keys (a.b.c); array indices become [0]. Processed locally.

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

「展平 JSON 对象」是什么?What is the Flatten JSON Object tool?

把嵌套 JSON 对象展平成单层,键用点号连接(a.b.c);数组下标写成 [0]。本地处理。Flatten a nested JSON object into one level with dotted keys (a.b.c); array indices become [0]. Processed locally.

如何使用「展平 JSON 对象」?How do I use the Flatten JSON Object tool?

在「展平 JSON 对象」中,把内容粘贴或输入到上方输入框,结果会实时显示在下方,点击「复制结果」即可复制。例如输入「{}」,得到「{}」。In the Flatten JSON Object: Paste or type into the input box; the result appears below instantly — click "Copy result" to copy it. Example: "{}" → "{}".

怎样还原?How do I unflatten?

本工具只做展平;需要嵌套结构时请用原始 JSON 或自行按点号拆回。This tool only flattens; keep the original JSON or rebuild nesting from dotted keys yourself.

键名里本来就有点号怎么办?What if a key already contains a dot?

含点号、方括号、引号或为空的键写成 ["a.b"] 形式,所以 {"a.b":1} 和 {"a":{"b":2}} 会得到两个不同的键,不会互相覆盖。Keys containing a dot, bracket or quote, or empty keys, are written as ["a.b"], so {"a.b":1} and {"a":{"b":2}} give two different keys instead of overwriting each other.

大数字和重复键会怎样?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 对象」中输入 {"a":{"b":1}},输出为:{ ⏎ "a.b": 1 ⏎ }(⏎ 表示换行)。For example, the Flatten JSON Object turns the input {"a":{"b":1}} into: { ⏎ "a.b": 1 ⏎ } (⏎ marks a line break).

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

「展平 JSON 对象」的设置:可勾选:「压缩输出」。每次生成结果都按当前设置处理。Settings in the Flatten JSON Object — tick boxes: "Minify". The result always uses the current settings.

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

不会。「展平 JSON 对象」完全用 JavaScript 在本地运行,适合处理含有密钥、内部接口等敏感内容的数据。No. The Flatten JSON Object runs entirely in local JavaScript, so it is safe for data containing keys or internal endpoints.

「展平 JSON 对象」免费吗?需要注册吗?Is the Flatten JSON Object free? Do I need an account?

「展平 JSON 对象」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Flatten JSON Object 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 数组Flatten JSON Array🔑 提取 JSON 键名Extract JSON Keys👁 隐藏 JSON 字符串内容Hide JSON Strings🔀 混淆 JSON(打乱键序 / 编码字符串)Obfuscate JSON⚙ JSON 转 Java PropertiesConvert JSON to Properties⚙ Java Properties 转 JSONConvert Properties to JSON📸 JSON 截图(导出为图片)Capture JSON Screenshot🖼️ JSON 转图片Convert JSON to Image💡 JSON 语法高亮(HTML)Highlight JSON🧱 JSON 转 BSON(十六进制)Convert JSON to BSON📊 TSV 分析Analyze TSV📄 文本转 TSVConvert Text to TSV🔗 JSON 合并工具JSON Merge Tool

← 全部工具All tools