Home › Code and dev › JSON Formatter
🔧

JSON Formatter

Format, minify and validate JSON online with a tree view and error positions

输入 JSON
输出结果

About this tool

JSON formatting is one of the most common online tasks for front-end and back-end developers. The tool covers the essentials:

  • Format: turn minified or messy JSON into readable, indented output with 2 or 4 spaces or a tab
  • Minify: strip all whitespace and newlines into a single line to cut payload size for transport
  • Validate: detect syntax errors such as missing quotes or commas and mismatched brackets, with the exact line and column
  • Escape and unescape: handle special characters in JSON strings so they can be embedded in code
  • Tree view: explore the hierarchy and expand or collapse nodes

When to use it

  • Debug JSON returned by an API
  • Read and inspect large configuration files
  • Minify JSON to reduce transfer size
  • Check that hand-written JSON is valid

Any size of JSON is supported and all parsing runs locally in the browser; nothing is uploaded.

JSON quick reference

  • Types: string in double quotes, number, boolean, null, array and object
  • Keys: always double quoted, for example "name": "Ada"
  • Common mistakes: trailing commas, single quotes and comments, which JSON does not allow
  • Content-Type: application/json, the standard for APIs