JSON Parse / Formatter

Drag file here, or click to select file

{
hello: "world"
}

JSON 转义/反转义

JSONPath 查询

支持 JSONPath 语法,如 $.store.book[0].title 或 $[0].name

Help

Full guide

What Can This Tool Do?

This tool provides comprehensive JSON processing features:

  • Format/Beautify: Convert compressed JSON to readable indented format
  • Syntax Validation: Automatically detect JSON syntax errors and indicate positions
  • Tree View: Visualize JSON structure with expand/collapse support
  • Escape/Unescape: Handle special characters in JSON strings
  • Minify/Compress: Remove whitespace to reduce JSON size

Tree View

JSON Tree View

The right panel shows a collapsible JSON tree structure for browsing complex data.

Format View

JSON Format

Automatically format compressed JSON into readable indented format.

Error Detection

JSON Error Detection

When JSON has syntax errors, the tool shows the exact location (line, column) for quick debugging.

Why Use JSON Formatting?

JSON formatting is useful in these scenarios:

  • Debugging API Responses: Server JSON is usually compressed; formatting makes it readable
  • Config File Editing: JSON config files need proper indentation for maintenance
  • Data Inspection: Quickly locate JSON structure issues and syntax errors
  • Code Development: Rapidly validate JSON data structures during development

JSON Syntax Rules

Valid JSON must follow these rules:

RuleCorrect ExampleWrong Example
Keys must use double quotes{"name": "John"}{name: "John"}
Strings use double quotes"Hello"'Hello'
Numbers without quotes{"age": 25}{"age": "25"}
Booleans are lowercase{"active": true}{"active": True}
No trailing commas{"a": 1, "b": 2}{"a": 1, "b": 2,}

Common JSON Errors and Solutions

1. Using Single Quotes

// ❌ Wrong
{'name': 'John'}

// ✅ Correct
{"name": "John"}

2. Keys Without Quotes

// ❌ Wrong
{name: "John"}

// ✅ Correct
{"name": "John"}

3. Extra Trailing Comma

// ❌ Wrong
{
  "items": [1, 2, 3,],
  "count": 3,
}

// ✅ Correct
{
  "items": [1, 2, 3],
  "count": 3
}

4. Comments Not Supported

// ❌ JSON doesn't support comments
{
  "name": "John" // username
}

// ✅ Use JSONC or remove comments
{
  "name": "John"
}

JSON Escape Character Reference

Escape SequenceMeaningUnicode
\"Double quoteU+0022
\\BackslashU+005C
\/Forward slashU+002F
\nNewlineU+000A
\rCarriage returnU+000D
\tTabU+0009
\uXXXXUnicode characterU+XXXX

Usage Tips

Quick Error Location

When JSON formatting fails, the error message points to the problem location. Common error messages:

  • Unexpected token - Syntax error, check quotes and commas
  • Expected property name - Key format error
  • Unexpected end of JSON - Incomplete JSON, check bracket matching

Large File Handling Tips

  • For JSON over 500KB, use file upload instead of paste
  • JSON over 1MB may cause browser lag
  • Use minify function to reduce size before processing

Related Tools