📝 JSON 编辑器

📐 使用说明与演算示例

演算示例:从压缩到美化 原始 JSON(压缩格式):
{"name":"EasyCalc","tools":["bmi","mortgage","salary"],"count":42}
格式化后:
{
  "name": "EasyCalc",
  "tools": ["bmi", "mortgage", "salary"],
  "count": 42
}
格式化不会改变数据内容,只是让结构更易读,方便调试和编辑。

💡 如何格式化 JSON?

将 JSON 字符串粘贴到左侧输入框,点击"格式化"按钮,右侧将以带缩进的易读格式展示。如果 JSON 格式有误,输入框下方会显示具体的错误行号和位置。

💡 压缩 JSON 有什么用?

压缩会移除所有空格和换行,生成一行紧凑的 JSON,适合在 URL 参数中传输或减小存储体积。

💡 为什么格式化后引号变成了转义符?

这通常是因为输入的内容本身就是一个字符串化的 JSON(即 JSON 套 JSON)。解决方法:先将输入内容用本工具格式化一次,如果看到外层多了转义符,说明原始数据被包裹在字符串中。此时可将转义后的内容再次粘贴到输入框,再次格式化即可得到真正的 JSON 对象。

💡 支持多大的 JSON 文件?

本工具完全在浏览器本地运行,理论上支持数十 MB 的 JSON 数据。但过大的文件(如超过 10MB)可能导致浏览器短暂卡顿。建议将超大文件分割后分批处理。

📝 JSON Editor

📐 Notes & Examples

Example: From Minified to Beautified Original JSON (minified):
{"name":"EasyCalc","tools":["bmi","mortgage","salary"],"count":42}
Formatted output:
{
  "name": "EasyCalc",
  "tools": ["bmi", "mortgage", "salary"],
  "count": 42
}
Formatting does not change the data — it only makes the structure human‑readable.

💡 How to format JSON?

Paste your JSON string into the left textarea and click "Format". The right panel will display the beautified version with indentation. If the JSON is invalid, an error message with line and position will appear below the input.

💡 Why minify JSON?

Minification removes all whitespace and line breaks, producing a compact single-line JSON ideal for URL parameters or reducing storage size.

💡 Why do quotes turn into backslashes after formatting?

This usually happens when your input is already a stringified JSON (JSON wrapped in quotes). If you see extra backslashes after formatting, copy the escaped output back into the input box and format again — this strips the outer string wrapper and reveals the real JSON structure.

💡 What's the maximum JSON file size?

This tool runs entirely in your browser. It can handle files up to tens of MB, but very large files (>10 MB) may cause temporary browser lag. For massive datasets, consider splitting them into smaller chunks.