What is JSON?
JSON (JavaScript Object Notation) is a lightweight, text-based data format for storing and exchanging structured data as key/value pairs and ordered lists. It is language-independent, easy for humans to read and machines to parse, and is the default format for web APIs and configuration.
A JSON document is built from two structures: objects (unordered key/value pairs in { }) and arrays (ordered lists in [ ]). Values can be strings, numbers, booleans, null, objects or arrays. Keys and strings use double quotes; there are no comments and no trailing commas.
JSON became the lingua franca of web APIs because it maps directly onto data structures in almost every language and parses natively in browsers. It is also widely used for configuration, logging and data storage.
JSON tools
常见问题
什么是 JSON5?
JSON5 是 JSON 的一个扩展格式,增加了多项便利特性:注释、尾随逗号、单引号字符串、无需引号的键名、十六进制数字/Infinity/NaN 等等。
JSON5 和 JSONC 一样吗?
不一样——JSONC(VS Code 中“带注释的 JSON”)只是增加了注释支持。JSON5 还额外支持尾随逗号、无需引号的键名、单引号字符串等更多特性。
有没有相关的其他工具?
<a class="text-brand-600 hover:underline" href="/json-formatter">JSON Formatter</a> 适用于严格标准的 JSON;如果需要处理完整的 YAML,可以使用 <a class="text-brand-600 hover:underline" href="/yaml-formatter">YAML Formatter</a>。