Send to AI
Generate TypeScript interfaces for this JSON. Infer union types for nullable fields and name the root interface after the likely domain concept. Output only the interfaces, no commentary: ```json ```
功能说明
JSON Formatter 完全在你的浏览器中完成 JSON 的美化、压缩和校验。粘贴任何 JSON——凌乱的、压缩过的、或是损坏的——它会返回缩进整洁、合法的 JSON,或者明确告诉你哪里出了错、错在哪里。所有操作 100% 在客户端完成:你粘贴的任何内容都不会被发送到服务器,因此可以放心处理敏感载荷。
使用方法
- 把 JSON 粘贴到输入框中(或点击 Sample 载入一份演示载荷)。
- 选择美化(pretty-print,2 空格缩进)或压缩(紧凑,无空白)。
- 在输出中读取格式化结果;如果 JSON 不合法,则读取错误信息。
- 复制结果,或复制分享链接,把精确的输入发给队友。
示例
美化压缩过的 JSON
输入:{"name":"CosmoDev","free":true,"tools":["json","base64"]}
输出:
{
"name": "CosmoDev",
"free": true,
"tools": ["json", "base64"]
}
捕获语法错误
输入:{"a": 1, "b": } → Expected property name or '}' in JSON at position 12。
补充说明
- 可分享: 你的输入被编码进 URL(
?j=...),因此一个链接就能重现精确的视图。 - 私密: 所有解析都在本地进行——可以安全处理密钥和凭据。
- 相关工具: JSON ↔ CSV、
Base64Base64An encoding representing binary data as 64 safe ASCII characters, so it survives transport through text-only channels. It encodes — it does not encrypt.
、JWTJWTA compact, URL-safe token that carries claims (like identity or expiry) between two parties, signed to prevent tampering.Learn more
Decoder。