首页Home › 开发工具Developer Tools

🔤 JSON 排序JSON Sorter

按键名递归排序 JSON 对象(升序/降序、自然排序),可选对数组排序或按某个字段排序对象数组,并格式化输出;超大整数不丢精度。Sort JSON object keys recursively (A–Z, Z–A or natural order), optionally sort arrays or arrays of objects by a field, and pretty-print — without losing precision on big integers.

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

「JSON 排序」是什么?What is the JSON Sorter tool?

按键名递归排序 JSON 对象(升序/降序、自然排序),可选对数组排序或按某个字段排序对象数组,并格式化输出;超大整数不丢精度。Sort JSON object keys recursively (A–Z, Z–A or natural order), optionally sort arrays or arrays of objects by a field, and pretty-print — without losing precision on big integers.

如何使用「JSON 排序」?How do I use the JSON Sorter tool?

在「JSON 排序」中,把内容粘贴或输入到上方输入框,按需设置「顺序」、「对象数组按字段」、「格式」,结果会实时显示在下方,点击「复制结果」即可复制。例如输入「{"a":1,"a":2,"b":{"c":1,"c":2}}」,得到「{ ⏎ "a": 2, ⏎ "b": { ⏎ "c": 2 ⏎ } ⏎ }」。In the JSON Sorter: Paste or type into the input box, adjust "Order", "Sort object arrays by", "Format"; the result appears below instantly — click "Copy result" to copy it. Example: "{"a":1,"a":2,"b":{"c":1,"c":2}}" → "{ ⏎ "a": 2, ⏎ "b": { ⏎ "c": 2 ⏎ } ⏎ }".

数组默认会被排序吗?Are arrays sorted by default?

不会。数组的顺序通常有意义,所以默认只排序对象的键;勾选“同时排序数组”后才会对数组排序,对象数组可指定按某个字段排序(数字按大小,文字按字母)。No — array order usually matters, so only object keys are sorted by default. Tick "Also sort arrays" to sort them; arrays of objects can be sorted by a field (numbers by value, text alphabetically).

大整数会丢失精度吗?Will big integers lose precision?

在支持 JSON.rawJSON 的浏览器(Chrome/Edge 114+、Firefox 135+、Safari 18.4+)中,超过 2^53 的整数会原样保留;旧浏览器会被 JavaScript 四舍五入。In browsers with JSON.rawJSON (Chrome/Edge 114+, Firefox 135+, Safari 18.4+) integers beyond 2^53 are kept exactly; older browsers round them, as JavaScript numbers do.

数据会上传吗?Is my data uploaded?

不会。转换完全在浏览器本地进行,适合处理内部数据。No. Conversion happens entirely in your browser, so it is safe for internal data.

「JSON 排序」免费吗?需要注册吗?Is the JSON Sorter free? Do I need an account?

「JSON 排序」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The JSON Sorter 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 转 SQLJSON to SQL Converter📊 Excel 转 CSVExcel to CSV Converter📊 Excel 转 HTML 表格Excel to HTML Table🧮 CRC 校验计算器CRC Calculator🔢 十进制转 BCD 码Decimal to BCD Converter🔁 二进制位反转Reverse Binary Numbers🗜️ XML 压缩XML Minifier✅ YAML 校验器YAML Validator🔷 GraphQL 格式化GraphQL Formatter🟦 TypeScript 格式化TypeScript Formatter🗺️ XML 网站地图生成器XML Sitemap Generator⚙️ 位运算计算器Bitwise Calculator

← 全部工具All tools