平 展平 JSON 数组Flatten JSON Array
把嵌套数组展平成一维(只展开数组,对象保持原样)。本地处理。可设置「只展一层」、「压缩输出」。Flatten nested arrays into one dimension (arrays only; objects stay as values). Processed locally. Settings: One level only, Minify.
使用说明与常见问题How-to & FAQ
「展平 JSON 数组」是什么?What is the Flatten JSON Array tool?
把嵌套数组展平成一维(只展开数组,对象保持原样)。本地处理。可设置「只展一层」、「压缩输出」。Flatten nested arrays into one dimension (arrays only; objects stay as values). Processed locally. Settings: One level only, Minify.
如何使用「展平 JSON 数组」?How do I use the Flatten JSON Array tool?
在「展平 JSON 数组」中,把内容粘贴或输入到上方输入框,结果会实时显示在下方,点击「复制结果」即可复制。例如输入「[1,[2,[3]]]」,得到「[ ⏎ 1, ⏎ 2, ⏎ 3 ⏎ ]」。In the Flatten JSON Array: Paste or type into the input box; the result appears below instantly — click "Copy result" to copy it. Example: "[1,[2,[3]]]" → "[ ⏎ 1, ⏎ 2, ⏎ 3 ⏎ ]".
对象里的数组会怎样?What about arrays inside objects?
对象整体当作一个元素保留,不会进入对象内部再展平。An object is kept as one element; flattening does not walk into objects.
大数字和重复键会怎样?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 数组」中输入 [1,[2,[3]]],输出为:[ ⏎ 1, ⏎ 2, ⏎ 3 ⏎ ](⏎ 表示换行)。For example, the Flatten JSON Array turns the input [1,[2,[3]]] into: [ ⏎ 1, ⏎ 2, ⏎ 3 ⏎ ] (⏎ marks a line break).
有哪些选项可以调整?What options can I adjust?
「展平 JSON 数组」的设置:可勾选:「只展一层」、「压缩输出」。每次生成结果都按当前设置处理。Settings in the Flatten JSON Array — tick boxes: "One level only", "Minify". The result always uses the current settings.
代码或数据会被上传吗?Is my code or data uploaded?
不会。「展平 JSON 数组」完全用 JavaScript 在本地运行,适合处理含有密钥、内部接口等敏感内容的数据。No. The Flatten JSON Array runs entirely in local JavaScript, so it is safe for data containing keys or internal endpoints.
「展平 JSON 数组」免费吗?需要注册吗?Is the Flatten JSON Array free? Do I need an account?
「展平 JSON 数组」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Flatten JSON Array is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.