JSON Formatter & Validator

JSON 格式化与校验

Pretty-print, minify, and validate JSON. Errors are reported inline.

美化、压缩和校验 JSON。错误会直接显示。

Video tutorial

视频教程

Common JSON mistakes

JSON 常见错误

  • Trailing comma — JSON does not allow commas after the last item.
  • 尾随逗号 —— JSON 不允许最后一个元素后有逗号。
  • Single quotes — JSON requires double quotes for keys and string values.
  • 单引号 —— 键和字符串值必须用双引号。
  • Comments — JSON does not support comments. Remove all // and /* */.
  • 注释 —— JSON 不支持注释。删除所有 ///* */
  • Undefined / NaN — these JavaScript values are not valid JSON. Use null instead.
  • undefined / NaN —— 这两个 JavaScript 值不是合法 JSON,请用 null